How to view the roles and permissions granted to any database user in Azure SQL server instance? -


could guide me on how view current roles/permissions granted database user in azure sql database or in general mssql server instance?

i have below query:

select r.name role_principal_name, m.name member_principal_name sys.database_role_members rm  join sys.database_principals r      on rm.role_principal_id = r.principal_id join sys.database_principals m      on rm.member_principal_id = m.principal_id r.name in ('loginmanager', 'dbmanager'); 

i further need know permissions granted these roles "loginmanager" , "dbmanager"?

could me on this?

thank sk

per msdn documentation sys.database_permissions, query lists permissions explicitly granted or denied principals in database you're connected to:

select pr.principal_id, pr.name, pr.type_desc,      pr.authentication_type_desc, pe.state_desc, pe.permission_name sys.database_principals pr join sys.database_permissions pe     on pe.grantee_principal_id = pr.principal_id; 

per managing databases , logins in azure sql database, loginmanager , dbmanager roles 2 server-level security roles available in azure sql database. loginmanager role has permission create logins, , dbmanager role has permission create databases. can view users belong these roles using query have above against master database. can determine role memberships of users on each of user databases using same query (minus filter predicate) while connected them.


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -