Granting permission to users on different schema

后端 未结 4 951
长情又很酷
长情又很酷 2021-02-14 21:20

I have tables in Schema A. I created views in Schema B using the tables in schema A.

I want to grant permissions to a user to select the data from view in Schema B.

4条回答
  •  轮回少年
    2021-02-14 21:43

    Let user A grant select on his tables to B and include the 'grant option'.

    As user A:

    GRANT select ON table TO user_b WITH GRANT OPTION;
    

    Let user B grant select on his views to user A and include the 'grant option'.

    As user B:

    GRANT select ON view TO user_a WITH GRANT OPTION;
    

    As user A:

    GRANT select on user_b.view TO user_c;
    

    This allows user A to pass this grant on to other users.

提交回复
热议问题