Skip to main content
Question

How to inherit object_schema's grants to VIEW and SEQUENCE?

  • September 14, 2020
  • 3 replies
  • 8 views

HyeontaeJu
Forum|alt.badge.img+2

Hello, Our team is managing user and object's grants,
By the way, it was found that the table inherited the grants of the schema, while the views and sequences did not inherit the grants of the schema.
So, our team gives each user grants to view and sequence, and this is causing inconvenience.
How to solve this inconvenience?

3 replies

Sankarmn
Forum|alt.badge.img+1
  • Participating Frequently
  • September 14, 2020

You can use, ALTER VIEW view1 INCLUDE SCHEMA PRIVILEGES;


DaveT
Forum|alt.badge.img
  • Participating Frequently
  • September 14, 2020

Yes, views should inherit the same way tables do. I suspect you might have an issue with view/table ownership. For example, if the view was created by a different owner than the table then the view owner needs SELECT WITH GRANT OPTION on the base table(s) (or inherited through schema) to have another user select from that view. The key to that is "select WITH GRANT OPTION".

Sequences don't inherit through the schema privileges like tables and views. You can use ALL SEQUENCES IN SCHEMA on the GRANT for sequences to help. However, I believe it only works for existing sequences and not for future sequences so you would have to reissue after creating new ones.


HyeontaeJu
Forum|alt.badge.img+2
  • Author
  • Participating Frequently
  • September 15, 2020

Why is the message occured?? When I use ALTER VIEW view1 INCLUDE SCHEMA PRIVILEGES;
"View "view" is already set to inherit privileges"