Subject Re: [firebird-support] Grant all to all
Author Julio César Carrascal Urquijo (MCTS)
On 3/24/07, rj1102 <rjm@...> wrote:
> What is the easiest way to grant all rights to all users for a database.
> I'm looking for something like GRANT ALL TO ALL.
> I.e even when i create a new table in the database, access will be
> automatically granted to all users.

I use the following stored procedure on test databases. You can easily
extend it to apply permissions to all users:

set term ^ ;

create procedure GrantAllTo (
userlogin varchar(31))
as
declare variable PermissionObject varchar(31);
begin
for select rdb$relation_name
from rdb$relations
where rdb$system_flag = 0
into :PermissionObject
do
begin
execute statement 'grant all on ' || :PermissionObject || ' to '
|| UserLogin|| ' with grant option';
end

for select rdb$procedure_name
from rdb$procedures
where rdb$system_flag = 0
into :PermissionObject
do
begin
execute statement 'grant execute on procedure ' ||
:PermissionObject || ' to '
|| UserLogin || ' with grant option';
end
end^

set term ; ^

--
Julio César Carrascal Urquijo
Microsoft Certified Technology Specialist
http://jcesar.3stecnoinformatica.com/