Sparker0i
Sparker0i

Reputation: 1851

Check roles assigned to user

In a DB2 database, I have created a few roles and granted a user to some roles like:

GRANT ROLE "Role1" TO USER "User1"

GRANT ROLE "Role2" TO USER "User1"

How do I check in SYSCAT or SYSIBMADM tables which user (User1) has access to which roles (Role1 , Role2)?

Upvotes: 1

Views: 8277

Answers (2)

Sparker0i
Sparker0i

Reputation: 1851

SELECT GRANTEE, ROLENAME, ROLEID FROM SYSIBM.SYSROLEAUTH

solved for me

Upvotes: 2

data_henrik
data_henrik

Reputation: 17118

I would recommend to use SYSIBMADM.PRIVILEGES. AUTHIDTYPE would be R for role.

Or query SYSCAT.ROLEAUTH to retrieve only the role information, e.g., who granted which role to which user.

Upvotes: 2

Related Questions