SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Grant (permission) on database:: ... where can I see these?


Grant (permission) on database:: ... where can I see these?

Author
Message
Danah
Danah
Valued Member
Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)

Group: General Forum Members
Points: 61 Visits: 57
If run the following statement:


use someDB;
grant select on database::someDB to someuser;



Is there anywhere I can see this permission using the object explorer?

If I go to the database user properties > securables tab, it doesn't show up (seems like the highest level shown here is schema).

If I go to the login properties > securables tab, it also doesn't show up.


PS: Are these two operations identical?


use someDB;
grant select on database::someDB to someuser;




use someDB;
grant select to someuser;


Gazareth
Gazareth
SSCertifiable
SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)

Group: General Forum Members
Points: 7756 Visits: 6045
Hi,
database user properties > securables tab > Search... > All Object of the types... > Databases > Voila!

Although I'd look at using the db_datareader database role instead if possible, it's a little more visible.

Cheers
Danah
Danah
Valued Member
Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)

Group: General Forum Members
Points: 61 Visits: 57
Yeah, this was just a simple example, I actually need to grant select, execute, view definition in this case, and similar more complex permissions in other cases.

It's a shame these are not easy to see once they have been applied.
Gazareth
Gazareth
SSCertifiable
SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)

Group: General Forum Members
Points: 7756 Visits: 6045
Not through the GUI, no. But there are various T-SQL statements for interrogating permissions too, e.g.

select *
from sys.database_permissions dp
inner join sys.database_principals p on p.principal_id = dp.grantee_principal_id
where class_desc = 'DATABASE'
Orlando Colamatteo
Orlando Colamatteo
SSC-Dedicated
SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)

Group: General Forum Members
Points: 39836 Visits: 14412
It would be advisable to create User-defined Database Roles, add your Database Users to the Roles, and only grant permissions or Fixed Role Membership to those Roles. The Roles will act as containers where you can always go to figure out what a given person can do in a database. If I ever need to add people to db_datareader (I prefer not too but sometimes it makes sense, usually for non-prod or ad hoc reporting) I still do not add Users directly to db_datareader. I add the User to a User-defined Database Role and add that Database Role to db_datareader. This keeps the user-to-role layout flat, i.e. Users can only belong to User-defined Database Roles (I aim for 1 to 1 User to User-defined Role, i.e. each user can only belong to one Role) which eases my auditing tasks and makes it easier to avoid a lot of the multi-role-membership and inherited membership oddities that can arise.

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search