Jacob:
Besides the SET DEFAULT ROLE <role>; to give a userid an initial role everytime they log in after that point, you can use the <username>.sysdbopen() function or the public.sysdbopen() function to set a role at connect time based on other criteria such as the app name or session's IP address. The <username>.sysdbopen() function executes for the user that owns the function and the public.sysdbopen() function executes for all users who do not have a private sysdbopen function that they own. Setting the role in the sysdbopen() function would work without changing any application code.
Note that there can also be a sysdbclose() function for user public or for any given user that works similarly which runs when the session disconnects from the server.
Art
------------------------------
Art S. Kagel, President and Principal Consultant
ASK Database Management Corp.
www.askdbmgt.com------------------------------
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