Grant SELECT permission on a view, but not on underlying objects

前端 未结 3 1481
名媛妹妹
名媛妹妹 2020-12-03 10:12

I often read that one purpose of a VIEW is security: to allow some users access to the underlying table, and other users to a derived view only. With that in mind I designed

3条回答
  •  醉话见心
    2020-12-03 10:43

    If you have your views in a different schema than the table, you must either grant the user access to the base table, "AUTHORIZE" the owner of the tables to the view like this:

    ALTER AUTHORIZATION ON reporting.MyViewName TO dbo
    

    In the example above dbo is the user owning the tables the reporting.MyViewName is accessing

提交回复
热议问题