Showing posts with label role. Show all posts
Showing posts with label role. Show all posts

Tuesday, March 27, 2012

Create table permission problem on dbo

I have 2 logins on a sql server database. Both appear identical in their
permissions. They both have been assigned a role which has permission to
create tables on the dbo user. One user can create tables in the dbo but the
other can't. Neither have specific db_owner permission. Any ideas?On Oct 5, 1:19 pm, Stu P <S...@.discussions.microsoft.com> wrote:
> I have 2 logins on a sql server database. Both appear identical in their
> permissions. They both have been assigned a role which has permission to
> create tables on the dbo user. One user can create tables in the dbo but the
> other can't. Neither have specific db_owner permission. Any ideas?
compare the two using sp_helplogins 'loginname' to see if you can find
something
Thanks
VS|||I think it would be better to be sure of what permissions those logins have
using following commands first.
exec sp_helplogins
exec sp_helpsrvrolemember
--
Ekrem Ã?nsoy
"Stu P" <StuP@.discussions.microsoft.com> wrote in message
news:EE30C124-4EB4-48C1-8D98-3C94623FDCB5@.microsoft.com...
>I have 2 logins on a sql server database. Both appear identical in their
> permissions. They both have been assigned a role which has permission to
> create tables on the dbo user. One user can create tables in the dbo but
> the
> other can't. Neither have specific db_owner permission. Any ideas?

Friday, February 17, 2012

Create DB Role owned by public

I use the following script in order to create db role:

USE [MyDB]
GO
CREATE ROLE [myRole] AUTHORIZATION [public]
GO

It doesn't work:
Msg 15405, Level 16, State 1, Line 1
Cannot use the special principal 'public'.

However this code works fine:

USE [MyDB]
GO
CREATE ROLE [myRole] AUTHORIZATION [dbo]
GO
ALTER AUTHORIZATION ON ROLE::[myRole] TO [public]
GO

So the question is why?


Seems to me like a bug, please post it on http://connect.microsoft.com/SQLServer/Feedback

Jens K. Suessmeyer.

http://www.sqlserver2005.de
|||

Yes, as Jens said, it sounds like a bug; thanks a lot for reporting it.

Now my question, why would you like to make “public” the owner of the role? It is the equivalent of saying “everyone is the owner”, therefore anyone can do whatever they want on the role (add, drop member, drop it or even take complete ownership of the role).

I would strongly recommend against granting such an elevated privilege (CONTROL or own any object) to public.

Please, let us know what is the scenario you are trying to solve and we will be glad to give some alternative suggestions.

Thanks a lot,

-Raul Garcia

SDE/T

SQL Server Engine

|||

Thanks for answer,

Actually I'm creating an application for managing SQL Server security

and as far as I see now the best solution is not to give users ability to choose 'public' as owner for db roles at all, right?

|||

Correct. That’s why we think it is a bug that ALTER AUTHORIZATION allows it.

Once again thanks a lot for the feedback and for reporting the bug.

-Raul Garcia

SDE/T

SQL Server Engine

Create DB Role owned by public

I use the following script in order to create db role:

USE [MyDB]
GO
CREATE ROLE [myRole] AUTHORIZATION [public]
GO

It doesn't work:
Msg 15405, Level 16, State 1, Line 1
Cannot use the special principal 'public'.

However this code works fine:

USE [MyDB]
GO
CREATE ROLE [myRole] AUTHORIZATION [dbo]
GO
ALTER AUTHORIZATION ON ROLE::[myRole] TO [public]
GO

So the question is why?


Seems to me like a bug, please post it on http://connect.microsoft.com/SQLServer/Feedback

Jens K. Suessmeyer.

http://www.sqlserver2005.de
|||

Yes, as Jens said, it sounds like a bug; thanks a lot for reporting it.

Now my question, why would you like to make “public” the owner of the role? It is the equivalent of saying “everyone is the owner”, therefore anyone can do whatever they want on the role (add, drop member, drop it or even take complete ownership of the role).

I would strongly recommend against granting such an elevated privilege (CONTROL or own any object) to public.

Please, let us know what is the scenario you are trying to solve and we will be glad to give some alternative suggestions.

Thanks a lot,

-Raul Garcia

SDE/T

SQL Server Engine

|||

Thanks for answer,

Actually I'm creating an application for managing SQL Server security

and as far as I see now the best solution is not to give users ability to choose 'public' as owner for db roles at all, right?

|||

Correct. That’s why we think it is a bug that ALTER AUTHORIZATION allows it.

Once again thanks a lot for the feedback and for reporting the bug.

-Raul Garcia

SDE/T

SQL Server Engine