Subject | Re: > Hi, > > I have a stored procedure, which is inserting/deleting some records fo |
---|---|
Author | ardatun |
Post date | 2010-05-24T12:14:08Z |
This is the answer I was looking for, thank you very much :)
--- In firebird-support@yahoogroups.com, Michael Ludwig <milu71@...> wrote:
>
> ardatun schrieb am 24.05.2010 um 11:25:55 (-0000):
>
> > I don't want this user to do anything else in the database other than
> > just executing the stored procedure.
> >
> > But, because the stored procedure is inserting/deleting records to
> > some tables, I need to give insert/delete grants to user5 for that
> > tables.
>
> No, you need to give the appropriate privileges to the procedure, not to
> the user, like in this example:
>
> SQL> show grant;
> /* Grant permissions for this database */
> GRANT INSERT ON PERM_LOG TO TRIGGER PERM_TRG
> GRANT INSERT ON PERM_TBL TO PROCEDURE PERM_PROC
> GRANT GURKO TO GURKI
> GRANT EXECUTE ON PROCEDURE PERM_PROC TO ROLE GURKO
>
> GURKI is a user here, who has been granted the GURKO role, which has
> been granted EXECUTE on the procedure, which has been granted INSERT
> on the table.
>
> So for your case:
>
> GRANT DELETE, INSERT ON SomeTable TO PROCEDURE sp_insert_records
>
> --
> Michael Ludwig
>