Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Grant (permission) on database:: ... where can I see these? Expand / Collapse
Author
Message
Posted Monday, December 10, 2012 7:18 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, February 21, 2013 10:26 PM
Points: 9, 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;

Post #1394849
Posted Tuesday, December 11, 2012 5:03 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 5:09 PM
Points: 1,880, Visits: 3,018
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
Post #1395056
Posted Tuesday, December 11, 2012 4:31 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, February 21, 2013 10:26 PM
Points: 9, 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.
Post #1395355
Posted Wednesday, December 12, 2012 5:26 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 5:09 PM
Points: 1,880, Visits: 3,018
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'
Post #1395601
Posted Wednesday, December 12, 2012 11:24 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 6:57 PM
Points: 7,094, Visits: 12,583
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
Post #1395821
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse