mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
RLS refactoring
This refactors rewrite/rowsecurity.c to simplify the handling of the default deny case (reducing the number of places where we check for and add the default deny policy from three to one) by splitting up the retrival of the policies from the application of them. This also allowed us to do away with the policy_id field. A policy_name field was added for WithCheckOption policies and is used in error reporting, when available. Patch by Dean Rasheed, with various mostly cosmetic changes by me. Back-patch to 9.5 where RLS was introduced to avoid unnecessary differences, since we're still in alpha, per discussion with Robert.
This commit is contained in:
@@ -19,7 +19,6 @@
|
||||
|
||||
typedef struct RowSecurityPolicy
|
||||
{
|
||||
Oid policy_id; /* OID of the policy */
|
||||
char *policy_name; /* Name of the policy */
|
||||
char polcmd; /* Type of command policy is for */
|
||||
ArrayType *roles; /* Array of roles policy is for */
|
||||
@@ -41,7 +40,7 @@ extern PGDLLIMPORT row_security_policy_hook_type row_security_policy_hook_permis
|
||||
|
||||
extern PGDLLIMPORT row_security_policy_hook_type row_security_policy_hook_restrictive;
|
||||
|
||||
extern void get_row_security_policies(Query *root, CmdType commandType,
|
||||
extern void get_row_security_policies(Query *root,
|
||||
RangeTblEntry *rte, int rt_index,
|
||||
List **securityQuals, List **withCheckOptions,
|
||||
bool *hasRowSecurity, bool *hasSubLinks);
|
||||
|
Reference in New Issue
Block a user