Re: Confused with security
From: Hugo Kornelis (hugo_at_pe_NO_rFact.in_SPAM_fo)
Date: 08/31/04
- Previous message: Narayana Vyas Kondreddi: "Re: Backup up warm-standby server"
- In reply to: Howard Carr: "Confused with security"
- Next in thread: Howard Carr: "Re: Confused with security"
- Reply: Howard Carr: "Re: Confused with security"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 31 Aug 2004 22:44:24 +0200
On Tue, 31 Aug 2004 19:03:22 GMT, Howard Carr wrote:
>I thought I understood what was happening - obviously not.
>
>Here is my problem:
>
>Using windows integrated security.
>No users should have access to the table directly.
>
>I have a UDF that I have granted select, insert, update, and delete on to a
>created roll that has windows users added to it.
>The user can select through the function ok. but when they try to insert,
>they get an error complaining of lack of rights to insert.
>I had to add insert rights to the table for the user to insert through the
>function.
>Is it becuse the function is a select statement, and it dynamically creates
>the update, insert methods directly against the table and by-passes the
>function and that is my problem?
>
>Thanks for any clarification.
>
Hi Howard,
Your guess is correct - welcome to the pitfalls of dynamic SQL.
If a stored procedure references a table owned by the same userid that
owns the stored procedure, no additional check for access right to that
table is made. Each user that has rights to execute the procedure can
access that table through that procedure. Other means of access to the
table still need explicit permissions for that user on the table!
Dynamic SQL is executed in a seperate environment, just as if the user
exeecuted the SQL from Query Analyzer. During execution, SQL is not aware
that this is started from a stored procedure. Therefor, the ownership
chain from procedure to table breaks when dynamic SQL is executed.
Best, Hugo
-- (Remove _NO_ and _SPAM_ to get my e-mail address)
- Previous message: Narayana Vyas Kondreddi: "Re: Backup up warm-standby server"
- In reply to: Howard Carr: "Confused with security"
- Next in thread: Howard Carr: "Re: Confused with security"
- Reply: Howard Carr: "Re: Confused with security"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|