Subject | Re: [ib-support] New User |
---|---|
Author | Lucas Franzen |
Post date | 2002-03-06T10:35:30Z |
Sandeep schrieb:
- you have a role which has assigned all rigths to your
tables/views/procedures and the new user's logging in with that role
- or you assign every rigth to PUBLIC in advance
- or (since I know you're using IBObjects) you assign all the rights to
your new user using a SchemaCache of your IBConnection like:
ib_Script.SQL.Clear;
with ibConnection.SchemaCache do
begin
for ii := 0 to TableNames.Count - 1 do
ib_Script.SQL.Add ( 'GRANT ALL ON ' + TableNames[ii] + ' TO
<NEW_USERNAME>;' );
for ii := 0 to ViewNames.Count - 1 do
ib_Script.SQL.Add ( 'GRANT ALL ON ' + ViewNames[ii] + ' TO
<NEW_USERNAME>;' );
for ii := 0 to ProcedureNames.Count - 1 do
ib_Script.SQL.Add ( 'GRANT EXECUTE ON ' + ProcedureNames[ii] + '
TO <NEW_USERNAME>;' );
ib_Script.Execute;
end;
Hth
Luc.
>Either:
> How do I assign a new user all the
> rights the owner of database has?
- you have a role which has assigned all rigths to your
tables/views/procedures and the new user's logging in with that role
- or you assign every rigth to PUBLIC in advance
- or (since I know you're using IBObjects) you assign all the rights to
your new user using a SchemaCache of your IBConnection like:
ib_Script.SQL.Clear;
with ibConnection.SchemaCache do
begin
for ii := 0 to TableNames.Count - 1 do
ib_Script.SQL.Add ( 'GRANT ALL ON ' + TableNames[ii] + ' TO
<NEW_USERNAME>;' );
for ii := 0 to ViewNames.Count - 1 do
ib_Script.SQL.Add ( 'GRANT ALL ON ' + ViewNames[ii] + ' TO
<NEW_USERNAME>;' );
for ii := 0 to ProcedureNames.Count - 1 do
ib_Script.SQL.Add ( 'GRANT EXECUTE ON ' + ProcedureNames[ii] + '
TO <NEW_USERNAME>;' );
ib_Script.Execute;
end;
Hth
Luc.