I know I've had developers tell me that either it was too complicated to run a SET ROLE statement, or that the application code (e.g., Ace reports, Perform screens) couldn't be modified to add SET ROLE. I was able to get around that by doing a GRANT DEFAULT ROLE role_name TO user_name. This automatically sets the role to the desired role_name based solely on the user_name that was used when connecting to the database, with no source code changes required.
Original Message:
Sent: Mon May 19, 2025 10:55 AM
From: Jacob Salomon
Subject: Which users have been granted which roles?
Hi Mark.
In my case, a user was requesting a set of identical privs to be granted to a large number of users. I proposed the idea of a role to my user but wanted to keep control of the granting. Hence my question to the group. And it was simple - a catalog whose name I might have guessed after a while.
That aside, my user rejected the idea of a role, likely because several apps would have to be modified to add the "set role" command. And most developers in a large wish to avoid the rigmarole of testing after the most minor (we think) of code changes.
------------------------------
Jacob Salomon
Original Message:
Sent: Mon May 19, 2025 10:12 AM
From: mark collins
Subject: Which users have been granted which roles?
Jacob,
Is it a case that the users would have to switch from role to role to do their work, and they don't want to do the SET ROLE TO xxxx? Or is it a case that each user would only have one role, and they don't want to manually run the SET ROLE statement after logging in?
If it is the latter, did you let them know that each user can have a default role that is assigned each time they connect to the database?
------------------------------
mark collins
Original Message:
Sent: Thu May 15, 2025 02:00 PM
From: Jacob Salomon
Subject: Which users have been granted which roles?
That was it, Mike! Thanks much.
Unfortunately for my efforts, it turns out that the solution to my user's issue will not involve roles. They don't want to deal with "set role" and it's too big a solution for their issue anyway.
------------------------------
Jacob Salomon
Original Message:
Sent: Thu May 15, 2025 12:57 PM
From: Mike Walker
Subject: Which users have been granted which roles?
Take a look at sysroleauth for the names of the roles.
------------------------------
Mike Walker
xDB Systems, Inc
www.xdbsystems.com
Original Message:
Sent: Thu May 15, 2025 12:08 PM
From: Jacob Salomon
Subject: Which users have been granted which roles?
Now this oughta be straightforward. (Famous last words?)
Which system catalog(s) can I query to see which users have granted a specific role?
In catalog sysusers I see a group (sysusers where usertype = "G") named "managers". (Fake name, of course). What query can I run to see which users have been granted that role? Or any role, for that matter? My google search keep turning up les-than-helpful advice to use dbschema or just displaying the same page from the "Guide to SQL Syntax".
Thanks, all!
(WOW! Less than a page! You're losing you touch, Jake! ;-)
------------------------------
Jacob Salomon
------------------------------