Grant select on view...

Posted on 2008-11-04
Last Modified: 2013-11-05
Sybase ASE 12.5

sample code:

sp_addlogin ahoor, password, dbase1

use dbase1
sp_adduser ahoor

create view vw_test
select * from dbase2..table1

grant select on vw_test to ahoor

-> login as ahoor
-> select * from vw_test
-> error: user ahoor is not a valid user in database dbase2.

I think this is strange. You create a view in a different database but to use it you still have to copy the users from database 1 to database 2? What is the purpose of creating a view if you still have to do that?
Or is there a way to use aliasses or whatever to get around this?
Question by:ahoor
    1 Comment
    LVL 19

    Accepted Solution

    The view is really just a stored query.  If you run the Select statement in the view definition, you have to have privs on the underlying tables; regardless of what database they are in.  If that were not the case, a DBO from on one database could completely circumvent the access controls of any other database.

    Another way to do this is to create the views in the database with the target tables as dbo, then the dbo only has to grant privs on the views.  I believe the view inherits the privs of the creator.


    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Suggested Solutions

    Digital marketing agencies have encountered both the opportunities and difficulties that emerge from working with a wide-ranging organizations.
    For Sennheiser, comfort, quality and security are high priority areas. This paper addresses the security of Bluetooth technology and the supplementary security that Sennheiser’s Contact Center and Office (CC&O) headsets provide.  
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now