Subject | Re: [firebird-support] Using "twice-dynamic" SQL in a stored procedure |
---|---|
Author | Helen Borrie |
Post date | 2008-01-15T22:49:28Z |
At 04:39 AM 16/01/2008, you wrote:
This isn't the right way to go about granting blocks of SQL privileges. You should create roles to pre-package the permissions and then have the appropriate admin user grant/revoke the appropriate role[s] to/from the users as and when required. As always, make sure that the creator and grantor are the same (admin-type) user (object-owner or SYSDBA). And if your idea of "dynamic" means granting and revoking permissions while the user is waiting at the gate, I'd urge to rethink this as a security model!
You could write a SP that generates a permissions script into an external file and EXECUTE STATEMENT would be ideal for that.
^heLen
>I have a set of tables having the same structure like "CREATE TABLEAs Alexandre said, EXECUTE STATEMENT would provide a workaround that would work from a structural POV. However, you will risking blowing up the ship if you try to grant SQL permissions by this means.
>tables_list1 (tblname VARCHAR(128))" (let's call them "list tables").
>These list tables contain the names of some other tables (let's call
>them "referenced tables"). I need to implement a stored procedure,
>which would accept the name of a list table via an input parameter and
>perform some actions on the referenced tables (granting different
>permissions on these tables, to be more precise). I would use a query
>like "FOR SELECT ... DO", but such a query requires the usage of a
>static table name, while in my case the table name is a variable (a
>parameter passed to my stored procedure). Is anybody aware of any
>solutions or workarounds for this problem?
This isn't the right way to go about granting blocks of SQL privileges. You should create roles to pre-package the permissions and then have the appropriate admin user grant/revoke the appropriate role[s] to/from the users as and when required. As always, make sure that the creator and grantor are the same (admin-type) user (object-owner or SYSDBA). And if your idea of "dynamic" means granting and revoking permissions while the user is waiting at the gate, I'd urge to rethink this as a security model!
You could write a SP that generates a permissions script into an external file and EXECUTE STATEMENT would be ideal for that.
>(I'm using Firebird 2.1)As this question is generic, I'm allowing the thread. However, for questions related to new features or changes in betas, please follow the instructions in the release notes and keep clear of this list.
^heLen