Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / General / Security / November 2008

Tip: Looking for answers? Try searching our database.

Do I need to grant permissions to table as well as view?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
AkAlan - 13 Nov 2008 18:40 GMT
I have several views and I have granted update permissions to different users
against these views but when the user tries to update they get a permission
denied error referencing the table the view is against. When I grant update
permission to the table to the users can update. I don't need to grant
permissions to the underlying table when using stored procedures in the same
manner. So should I change my design to use stored procedures instead of
views if I don't want the hassle of assigning permissions to tables or am I
missing something?
Russell Fields - 14 Nov 2008 19:33 GMT
AkAlan,

Well, it works fine for me on SQL Server 2005 to GRANT UPDATE to a view, but
not to the underlying table.   Are your views against tables in the same
database?  Are you using 2005?  Any other clues?

RLF

>I have several views and I have granted update permissions to different
>users
[quoted text clipped - 9 lines]
> I
> missing something?
Dan Guzman - 15 Nov 2008 22:08 GMT
Try creating the view WITH VIEW_METADATA.  Some applications retrieve
metadata via the APIs and attempt to access to the underlying tables unless
the VIEW METADATA option is specified.

Signature

Hope this helps.

Dan Guzman
SQL Server MVP
http://weblogs.sqlteam.com/dang/

>I have several views and I have granted update permissions to different
>users
[quoted text clipped - 9 lines]
> I
> missing something?
Kalen Delaney - 16 Nov 2008 02:31 GMT
Hi AkAlan

It depends on whether the view and the table are have the same owner (or are
in the same schema). If they have the same owner, then SQL Server will not
recheck permissions on the table if the right permissions are available on
the view. However, if the view and the table have different owners,
permissions has to be granted to the table separately.

You can read about this behavior in the article called "Ownership" chains in
the Books Online.

Signature

HTH
Kalen Delaney, SQL Server MVP
www.InsideSQLServer.com
www.SQLTuners.com

>I have several views and I have granted update permissions to different
>users
[quoted text clipped - 9 lines]
> I
> missing something?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.