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

Objects Accessible by a Login / User Expand / Collapse
Author
Message
Posted Monday, July 6, 2009 5:45 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Thursday, November 13, 2014 6:17 AM
Points: 87, Visits: 403
Dear All,

Do we have any commands or workarounds to find out the list of objects whether a particular user is having rights on it?

Or in other way

For a particular user what are the objects and what kind of permission he is having...

Can anyone please help....
Post #747632
Posted Monday, July 6, 2009 8:09 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 7:12 AM
Points: 31,284, Visits: 15,746
http://blog.sqlauthority.com/2007/10/23/sql-server-get-permissions-of-my-username-userlogin-on-server-database/






Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #747762
Posted Tuesday, July 7, 2009 7:02 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Thursday, November 13, 2014 6:17 AM
Points: 87, Visits: 403
Hi, This one is good. But to find out this i need to login using that specific id and execute this query which is difficult for a huge no of logins... Can you please help with someother way of finding the Objects having what kind of access rights for a specific login.

Please help...
Post #748503
Posted Tuesday, July 7, 2009 10:07 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 7:12 AM
Points: 31,284, Visits: 15,746
It's going to be a huge mess in any case. The dump of permissions for objects for users is a huge amount of data, and it's impossible to read. It's just too much information for almost any database.

What is the purpose here? Are you just documenting this? Or storing it for an audit? If you're going to use it, you only want to see permissions for an object or user/role, one at a time.







Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #748697
Posted Tuesday, July 7, 2009 10:08 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 7:12 AM
Points: 31,284, Visits: 15,746
Also, you can use SETUSER to run this for any login, and then REVERT back to your user. Add a script around that and you can easily get all permissions.






Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #748699
Posted Thursday, July 9, 2009 12:33 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Thursday, May 22, 2014 7:04 AM
Points: 1,688, Visits: 8,766
--This script will generate all user permissions and the code to
recreate them as required.


SELECT C.name 'Schema',
B.name AS Object,
D.name username,
A.type permissions_type,
A.permission_name,
A.state permission_state,
A.state_desc,
state_desc
+ ' ' + permission_name
+ ' ON ['+ C.name
+ '].[' + B.name + '] to ['
+ D.name
+ ']' COLLATE LATIN1_General_CI_AS AS
Generated_Code
FROM sys.database_permissions AS A JOIN sys.objects AS B ON
A.major_id =
B.object_id
JOIN sys.schemas AS C ON B.schema_id =
C.schema_id
JOIN sys.database_principals AS D ON
A.grantee_principal_id = D.principal_id
ORDER BY 1, 2, 3, 5

MJ
Post #750546
Posted Friday, July 10, 2009 4:28 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Thursday, November 13, 2014 6:17 AM
Points: 87, Visits: 403
This helps! Thks a lot!
Post #750943
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse