Subject | Re: > Hi, > > I have a stored procedure, which is inserting/deleting some records fo |
---|---|
Author | ardatun |
Post date | 2010-05-24T13:58:56Z |
Thank you again but it didn't work??
I granted the user to run the stored procedure,
granted the stored procedure to insert to another table,
but I still have that "insufficient SQL rights" error..
Can it be something related with firebird version FirebirdCS-2.1.2.18118?
For testing purposes, I created an other stored procedure as SYSDBA
------------------------
CREATE PROCEDURE SP_TEST RETURNS (
ID INTEGER)
AS
BEGIN
FOR SELECT ID FROM MYTABLE into :ID DO suspend;
END
------------------------
Then,
------------------------
GRANT EXECUTE ON PROCEDURE SP_TEST TO MYUSER;
GRANT SELECT ON MYTABLE TO SP_TEST;
------------------------
After that, I connected to the database as MYUSER.
And I could not execute this
------------------------
SELECT * FROM Z_TEST
------------------------
Is it because I am executing the procedure using the select command?
I granted the user to run the stored procedure,
granted the stored procedure to insert to another table,
but I still have that "insufficient SQL rights" error..
Can it be something related with firebird version FirebirdCS-2.1.2.18118?
For testing purposes, I created an other stored procedure as SYSDBA
------------------------
CREATE PROCEDURE SP_TEST RETURNS (
ID INTEGER)
AS
BEGIN
FOR SELECT ID FROM MYTABLE into :ID DO suspend;
END
------------------------
Then,
------------------------
GRANT EXECUTE ON PROCEDURE SP_TEST TO MYUSER;
GRANT SELECT ON MYTABLE TO SP_TEST;
------------------------
After that, I connected to the database as MYUSER.
And I could not execute this
------------------------
SELECT * FROM Z_TEST
------------------------
Is it because I am executing the procedure using the select command?
--- In firebird-support@yahoogroups.com, "Alan McDonald" <alan@...> wrote:
>
> > Hi,
> >
> > I have a stored procedure, which is inserting/deleting some records for
> > some tables. I have given the grant like;
> > grant execute on procedure sp_insert_records to user5;
> >
> > He only knows how to connect to the database and the name of the stored
> > procedure he will run, with the defined parameters. He doesn't know any
> > other object name in the database. 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.
> >
> >
> > So, I am afraid, if user5 knows the names of the tables, he can cause
> > problems.
> >
> > Is there a way to give user5 just to execute the stored procedure and
> > nothing else and still have the capability for inserting and deleting?
> >
> > Thank you for any ideas
> >
>
> Grant execute on the SP to the user. Grant insert on the table to the SP.
> Alan
>