Re: Granting EXEC for read only SPs
- From: "Felix Albert" <felix.np@xxxxxxxxx>
- Date: Mon, 28 Apr 2008 14:10:48 -0400
Even in the case when the user have no rights to insert , delete or update a table directly , if the user has the EXECUTE permission granted for a stored proc that inserts, deletes or updates that table will work without errors.... the correct approach is to assign the EXEC permission only to the stored procs that don't modify the data... it looks like you are actually trying to identify the stored proc exec permissions "a posteriori".
Regards,
Felix
"Russell Fields" <russellfields@xxxxxxxxxx> wrote in message news:OiEXEr#pIHA.4476@xxxxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxIs 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: Russell Fields
- Re: Granting EXEC for read only SPs
- References:
- Granting EXEC for read only SPs
- From: BGL
- Re: Granting EXEC for read only SPs
- From: Russell Fields
- Granting EXEC for read only SPs
- Prev by Date: Re: Minimum permissions to restore a database
- Next by Date: Re: Granting EXEC for read only SPs
- Previous by thread: Re: Granting EXEC for read only SPs
- Next by thread: Re: Granting EXEC for read only SPs
- Index(es):
Relevant Pages
|
|