Re: Stored Procedure security



JWOL,

Ownership chaining only applies to object permisions, such as SELECT,
UPDATE, DELETE, and INSERT. Although you might think that TRUNCATE TABLE is
just a fast DELETE, the permission needed is actually not to an object, but
to the ability to ALTER the object. This has its own permission structure.

Instead of TRUNCATE TABLE, you can simply DELETE FROM TABLE and get the same
results, with more logging.

If you are running SQL Server 2005, you can create a procedure which is
signed by a certificate. That certificate can have the rights you need to
do more powerful actions than ownership chaining support. See:
http://www.sommarskog.se/grantperm.html

RLF

"JWOL" <chairleg@xxxxxxxxx> wrote in message
news:1193851982.107373.169900@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,

I have a stored procedure which inserts some data into a table and
then runs a select on the table. I have granted execute permissions
on the stored procedure to a user x. Although user x has no select or
insert permissions on the table the stored procedure will run, as I
expected. However, when I introduce a truncate table command into the
stored procedure the user can no longer execute it. It only works if
I grant ALTER permissions on the table to the user. What are the
rules for which permissions are inherited from stored procedures and
which aren't?

Thanks.



.



Relevant Pages

  • Permissions for executing a stored procedure
    ... Truncate table permissions only default to table owner, ... So, eventhough, you have granted execute permissions to ... Instead using TRUNCATE TABLE, you could use DELETE FROM, ... >We have a stored procedure that has code in it to ...
    (microsoft.public.sqlserver.security)
  • Re: Deny access to all users (including Administrator and DomainAd
    ... permissions on stored procedure override ... applictaion's user account permissions to the stored procedure which will ... Will try to deny access through the query for SQL Server 2005 and 2000. ... Remove everyone that you don't want rom an Administrator Groups ...
    (microsoft.public.sqlserver.security)
  • Re: public role question
    ... I didn't understand what Dan was asking me to do. ... Then I am able to create a stored procedure. ... system tables with select permissions. ... You ARE the special DBO user, and not the new user, which is why you have ...
    (microsoft.public.sqlserver.security)
  • Re: public role question
    ... I logged on to the database through QA as dantest. ... "Dan Guzman" wrote: ... Windows group and thereby get sysadmin permissions. ... Then I am able to create a stored procedure. ...
    (microsoft.public.sqlserver.security)
  • Re: public role question
    ... Who is the owner of the database? ... "Dan Guzman" wrote: ... Windows group and thereby get sysadmin permissions. ... Then I am able to create a stored procedure. ...
    (microsoft.public.sqlserver.security)