[YSQL] Support row level security (RLS) as per Postgres #1870
Labels
area/ysql
Yugabyte SQL (YSQL)
community/request
Issues created by external users
kind/enhancement
This is an enhancement of an existing feature
Projects
Milestone
About the feature
Row level security in PostreSQL allows the DBA to set 'row security policies that restrict, on a per-user basis, which rows can be returned by normal queries or inserted, updated, or deleted by data modification commands. '
Use case
Many use cases come to mind, but for multi-tenant SaaS apps this is a critical feature. It allows the app to store data of multiple clients in the same table and greatly minimizes/eliminates the chance of interference.
The feature is described very well in the PostgreSQL docs -> https://www.postgresql.org/docs/11/ddl-rowsecurity.html. Other RDBMs like SQL Server, Oracle etc also support it and most likely in more advanced forms.
The order is pretty simple:
A policy is created for a table using syntax like
then the table must be altered to enable RLS like so
now the user / session MUST match the policy of the table to be permitted to see rows / modify data.
The text was updated successfully, but these errors were encountered: