Subject RE: [Firebird-Architect] Execute procedure using Role ?
Author Leyne, Sean
> What I actually had in mind something more along the lines of:
> GRANT <rolename> TO PROCEDURE <procedure-name>;
> whereupon the procedure would automatically execute within
> the context of that <rolename>. The second piece of the puzzle
> would be a context variable EXECUTION_ROLE that could be used
> by SQL code to tell the actual executing role/context from the
> users connection role given.

What you have described in not so much a "Role" but rather a "Mode".


> The idea would be that the engine would take care of the role
> scope automatically; opening the new scope at start of execute
> and closing and end. If I have to use my own variable (such
> as with package private variables) then to achieve the same
> result I would have to enclose the desired code in BEGIN...
> WHEN ANY ... END block (no big deal but neater without).

This type of functionality is already supported via the RDB$Context
(Transaction and Session) variable namespaces.


Sean