Fix the 'Roles for Each Web User' example (#313)
Add missing `ALTER TABLE ... ENABLE ROW LEVEL SECURITY;`
This commit is contained in:
@@ -61,6 +61,8 @@ You can use row-level security to flexibly restrict visibility and access for th
|
|||||||
message_body TEXT
|
message_body TEXT
|
||||||
);
|
);
|
||||||
|
|
||||||
|
ALTER TABLE chat ENABLE ROW LEVEL SECURITY;
|
||||||
|
|
||||||
We want to enforce a policy that ensures a user can see only those messages sent by him or intended for him. Also we want to prevent a user from forging the message_from column with another person's name.
|
We want to enforce a policy that ensures a user can see only those messages sent by him or intended for him. Also we want to prevent a user from forging the message_from column with another person's name.
|
||||||
|
|
||||||
PostgreSQL (9.5 and later) allows us to set this policy with row-level security:
|
PostgreSQL (9.5 and later) allows us to set this policy with row-level security:
|
||||||
|
|||||||
Reference in New Issue
Block a user