patternsqlMinor
can access to a view be controlled by access to a referenced table?
Viewed 0 times
canreferencedtableviewaccesscontrolled
Problem
I have a table
If I deny
Is there a way that I can force the view to return an error when the user tries to use it?
The real world case here is a database with about 20 tables and hundreds of views. User access is logically tied to the tables so we are hoping to stop folks from using the views based on those tables.
Table_A and a view View_A that is a select of the contents of Table_A.If I deny
SELECT on Table_A to a user, the user can still use the view View_A.Is there a way that I can force the view to return an error when the user tries to use it?
The real world case here is a database with about 20 tables and hundreds of views. User access is logically tied to the tables so we are hoping to stop folks from using the views based on those tables.
Solution
You need to give the views a different owner than the tables so that the ownership chain is broken and the permissions are checked on the base objects.
Context
StackExchange Database Administrators Q#20658, answer score: 4
Revisions (0)
No revisions yet.