Reputation: 117
So I know how to grant privileges on tables:
GRANT SELECT, INSERT, UPDATE, DELETE ON table TO person;
But I was told to grant privileges to 'person' for all tables and views and I was wondering if the above code also grants privileges for views as well or is there another way to do that?
Thanks a ton!
Upvotes: 0
Views: 1096
Reputation: 116100
The same code also can be used for views and even stored procedures. Commonly you would want access to update data in a table:
GRANT SELECT, INSERT, UPDATE, DELETE ON table TO person;
just SELECT on a view:
GRANT SELECT ON view TO person;
and EXECUTE on a procedure:
GRANT EXECUTE ON proc TO person;
There is some nuance in that. For instance, you can have updatable views (or views with triggers), and you may choose to assign only select and/or insert access to table.
Upvotes: 1