Subject | RE: [Firebird-Architect] Execute procedure using Role ? |
---|---|
Author | Leyne, Sean |
Post date | 2009-05-26T21:52:27Z |
> What I actually had in mind something more along the lines of:What you have described in not so much a "Role" but rather a "Mode".
> 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.
> The idea would be that the engine would take care of the roleThis type of functionality is already supported via the RDB$Context
> 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).
(Transaction and Session) variable namespaces.
Sean