Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

select permission on view Expand / Collapse
Author
Message
Posted Wednesday, March 6, 2013 12:06 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 10:18 AM
Points: 1,787, Visits: 3,241
I understand one reason to use view is for security.

So we have a view and granted a user select permission to that view.

But we got a denied message when select the view?

The SELECT permission was denied on the object 'table1', database 'mydb', schema 'dbo'.

It is denied because it doesn't have select for underlying table. My understand is we don't need underlying table permisson.

Why it asks underlying table permission?

One thing i notice though the view is different schema than the underlying table, does it make a difference?

Thanks
Post #1427572
Posted Wednesday, March 6, 2013 12:10 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 5:05 PM
Points: 20,738, Visits: 32,520
Possible change in the ownership chain. Who owns the view and who owns the underlying table(s)?



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1427573
Posted Wednesday, March 6, 2013 12:15 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 10:18 AM
Points: 1,787, Visits: 3,241
how can I find out the owner of a view or the owner of table,

I click view- property, I don't see anywhere says owner?

Thanks
Post #1427575
Posted Wednesday, March 6, 2013 12:23 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 5:05 PM
Points: 20,738, Visits: 32,520
Are the schemas owned by the principal?

select * from sys.schemas;



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1427581
Posted Wednesday, March 6, 2013 12:24 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:09 PM
Points: 12,905, Visits: 32,166
if the view "dbo.myview" references any objects in another database, a linked server or a schema different than dbo, then that's breaking the cross database chain.

you said it was referencing another schema, so the user needs permissions on the underlying object.

if it's a view referencing another database, and you'd have to create the user in that database as well.


Lowell

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1427583
Posted Wednesday, March 6, 2013 12:28 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 10:18 AM
Points: 1,787, Visits: 3,241
Lowell (3/6/2013)
if the view "dbo.myview" references any objects in another database, a linked server or a schema different than dbo, then that's breaking the cross database chain.

i suspect it's a view referencing another database, and you'd have to create the user in that database as well.


Thanks, Lowell, you are right.

This view is like external.myview

The underlying tables are in a different database on the same server but it is dbo schema.
And the user is in that database, but it does not have select permission on that new table.

So I think I will just need to add the table to the role.

So this is a break cross database chain issue, thanks
Post #1427587
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse