Using Views for Security

From: DebHerman (DebHerman_at_discussions.microsoft.com)
Date: 05/18/05


Date: Tue, 17 May 2005 22:04:02 -0700

I am using SQL views to aid with security in my SQL Server implementation.
For example I create viewA as select field1, field2 from TAble1. I grant
select access to viewA to user1 but not access to the underlying table. As
long as the owner of viewA has permissions to the table user1 can access the
view but not the table. This works great. However I want to take this one
step further in that viewA acutally is created on tables in another database
on the same server. In this scenario I give select access to viewA to
User1. The owner of viewA rights to the table is the other database; he
even has dbo rights to the database. In this case user1 can't select from
viewA. User1 gets the error that he does not have rights to the table in the
other database. Is there something I am missing or is this not allowed. I
can't find any specific documentation regarding this. Thanks.