Re: Granting EXEC for read only SPs
- From: "Russell Fields" <russellfields@xxxxxxxxxx>
- Date: Sat, 26 Apr 2008 18:13:31 -0400
BGL,
The whole point of granting a person rights to a stored procedure is for
them to be able to run a step that they normally cannot run. So, your
problem is that the stored procedure is running under its own rights
(probably db_owner) instead of the user to who you gave the denydatawriter
permission. See discussions on ownership chaining:
http://msdn2.microsoft.com/en-us/library/ms188676.aspx
Therefore there is no way to do what you are trying. You need to know what
a stored procedure is doing before granting rights to it.
If you do not want to individually grant rights to the 'harmless' stored
procedures, you could, I suppose, go through your stored procedures to find
every one that does updates, inserts, and deletes to your data (but not to
tempdb tables or to table variables). Once you have done that, you could
add a line of code at the start of each of those sprocs to do:
IF IS_MEMBER('db_denydatawriter') = 1
RETURN (1)
FWIW
RLF
"BGL" <BGL@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:FA9FC969-79B8-4318-AE86-7F925300D729@xxxxxxxxxxxxxxxx
Is there any way to grant EXEC on all SPs to a user or role where the SPs
don't modify user tables?
I created database role 'X' and granted EXEC permission for all SPs.
Then,
I created a database user, added it to the role 'X' to inherit the EXEC
permissions, AND ALSO added the user to the fixed database role
'denydatawriter'.
I was hoping this scenrio would lead to a run-time error when the SPs that
modify data were invoked. Instead, all SPs execute successfully,
including
the ones that modify data. Any workaound to accomplish this? TIA.
.
- Follow-Ups:
- Re: Granting EXEC for read only SPs
- From: Felix Albert
- Re: Granting EXEC for read only SPs
- References:
- Granting EXEC for read only SPs
- From: BGL
- Granting EXEC for read only SPs
- Prev by Date: Granting EXEC for read only SPs
- Next by Date: Re: SQL 2000 Lockout?
- Previous by thread: Granting EXEC for read only SPs
- Next by thread: Re: Granting EXEC for read only SPs
- Index(es):
Relevant Pages
|
|