Back to articles
Users, Roles, Groups

Users, Roles, Groups

via Dev.to BeginnersSandhya Steffy M

Task 1: Create a login role report_user that can only read from the film table CREATE ROLE report_user WITH LOGIN PASSWORD 'report123'; GRANT SELECT ON film TO report_user; Task 2: Now try to access customer table. When report_user tries to query customer and gets permission denied. Fix it. To allow report_user to read the full customer table: GRANT SELECT ON customer TO report_user; Task 3: Allow report_user to see only customer_id, first_name, last_name of the customer table If full SELECT was already given in Task 2, first remove it, then give column-level permission: REVOKE SELECT ON customer FROM report_user; GRANT SELECT (customer_id, first_name, last_name) ON customer TO report_user; Task 4: Create support_user who can SELECT from customer, UPDATE only email column, Cannot DELETE CREATE ROLE support_user WITH LOGIN PASSWORD 'support123'; GRANT SELECT ON customer TO support_user; GRANT UPDATE (email) ON customer TO support_user; DELETE permission is not given, so support_user can

Continue reading on Dev.to Beginners

Opens in a new tab

Read Full Article
6 views

Related Articles