Views, Table Permissions and Stored Procedures
From: Robert Strickland (strickra_at_rjsonline.net)
Date: 10/28/03
- Next message: supernova: "sp3a problem"
- Previous message: Valério: "How get WIN NT/2000 users full name?"
- Next in thread: Sue Hoegemeier: "Re: Views, Table Permissions and Stored Procedures"
- Reply: Sue Hoegemeier: "Re: Views, Table Permissions and Stored Procedures"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Tue, 28 Oct 2003 09:47:51 -0500
We have an application where clients have their database at a central
location; one database handles one or more clients. We want to secure the
database by allowing just execution rights on the stored procedures for each
client and use views to limit the viewable data based on the user id in the
connection string (we use the CURRENT_USER in the where clause of the view).
For example, client A can run a stored procedure that selects data but gets
back data for client A. There is no way for Client A to view Client B's
data. All works fine until we run stored procedures that have dynamic sql
and use the 'exec' and 'sp_executesql'. The client user id (each client has
a different user id and password) does not have rights to the views - just
the stored procedures. However, the dynamic sql in the stored procs runs
under the context of the logon user id and fails because that user does not
have permissions for that view. We would have to allow select/insert/delete
etc. permissions for each view for each user id which is not what we want
from a security point.
What is the prefered way or best practice for using dynamic sql in stored
procedures but still lock down all resources except the stored procedures?
Thanks
Bob
- Next message: supernova: "sp3a problem"
- Previous message: Valério: "How get WIN NT/2000 users full name?"
- Next in thread: Sue Hoegemeier: "Re: Views, Table Permissions and Stored Procedures"
- Reply: Sue Hoegemeier: "Re: Views, Table Permissions and Stored Procedures"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|