Solved

Stored Procedure permissions--does Execute give proxy to all tables?

Posted on 2011-09-28
2
252 Views
Last Modified: 2012-05-12
Hi all,
I have a general question about permissions within sql server, version 2008 or 2005.

I have a server login called kang who only has server role public and nothing else.
In one of the databases on this server I have a user kang mapped to this login kang.

The kang user in the database has Execute permission on a stored procedure, but kang has no explicit permissions on any tables in the database and is not db_datareader or any other role.  Now, in this procedure, I have a simple select statement on a table.  
When I use ADO using this user in the connection string to open a recordset based on this procedure I get data.
So my question is, as long as a user has Execute on the sp then by proxy he can access any object referenced in that procedure?

I'm not complaining, this works out because I don't want to have to give explicit pemrissions to this user for the tables in question, but I do want him to see them when he goes through the stored procedure.

The reason I ask is because I've read about the "With Execute As" clause and it would appear that any procedure alrady has "With Execute as Owner" by default.  Is this true?  And is is normal that the aforementioned user kang should access any object that I put in the procedure as long as he has permissions on that procedure?
Thanks,
James
0
Comment
Question by:prairie1
2 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 250 total points
ID: 36812672
>So my question is, as long as a user has Execute on the sp then by proxy he can access any object referenced in that procedure?
yup, it will have permission to access that table
0
 

Author Closing Comment

by:prairie1
ID: 36812698
Thanks vey much. Do you know why there is that 'Execute as' clause?  It seems moot.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question