PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
acl.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * acl.h
4  * Definition of (and support for) access control list data structures.
5  *
6  *
7  * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/utils/acl.h
11  *
12  * NOTES
13  * An ACL array is simply an array of AclItems, representing the union
14  * of the privileges represented by the individual items. A zero-length
15  * array represents "no privileges". There are no assumptions about the
16  * ordering of the items, but we do expect that there are no two entries
17  * in the array with the same grantor and grantee.
18  *
19  * For backward-compatibility purposes we have to allow null ACL entries
20  * in system catalogs. A null ACL will be treated as meaning "default
21  * protection" (i.e., whatever acldefault() returns).
22  *-------------------------------------------------------------------------
23  */
24 #ifndef ACL_H
25 #define ACL_H
26 
27 #include "access/htup.h"
28 #include "nodes/parsenodes.h"
29 #include "utils/array.h"
30 #include "utils/snapshot.h"
31 
32 
33 /*
34  * typedef AclMode is declared in parsenodes.h, also the individual privilege
35  * bit meanings are defined there
36  */
37 
38 #define ACL_ID_PUBLIC 0 /* placeholder for id in a PUBLIC acl item */
39 
40 /*
41  * AclItem
42  *
43  * Note: must be same size on all platforms, because the size is hardcoded
44  * in the pg_type.h entry for aclitem.
45  */
46 typedef struct AclItem
47 {
48  Oid ai_grantee; /* ID that this item grants privs to */
49  Oid ai_grantor; /* grantor of privs */
50  AclMode ai_privs; /* privilege bits */
51 } AclItem;
52 
53 /*
54  * The upper 16 bits of the ai_privs field of an AclItem are the grant option
55  * bits, and the lower 16 bits are the actual privileges. We use "rights"
56  * to mean the combined grant option and privilege bits fields.
57  */
58 #define ACLITEM_GET_PRIVS(item) ((item).ai_privs & 0xFFFF)
59 #define ACLITEM_GET_GOPTIONS(item) (((item).ai_privs >> 16) & 0xFFFF)
60 #define ACLITEM_GET_RIGHTS(item) ((item).ai_privs)
61 
62 #define ACL_GRANT_OPTION_FOR(privs) (((AclMode) (privs) & 0xFFFF) << 16)
63 #define ACL_OPTION_TO_PRIVS(privs) (((AclMode) (privs) >> 16) & 0xFFFF)
64 
65 #define ACLITEM_SET_PRIVS(item,privs) \
66  ((item).ai_privs = ((item).ai_privs & ~((AclMode) 0xFFFF)) | \
67  ((AclMode) (privs) & 0xFFFF))
68 #define ACLITEM_SET_GOPTIONS(item,goptions) \
69  ((item).ai_privs = ((item).ai_privs & ~(((AclMode) 0xFFFF) << 16)) | \
70  (((AclMode) (goptions) & 0xFFFF) << 16))
71 #define ACLITEM_SET_RIGHTS(item,rights) \
72  ((item).ai_privs = (AclMode) (rights))
73 
74 #define ACLITEM_SET_PRIVS_GOPTIONS(item,privs,goptions) \
75  ((item).ai_privs = ((AclMode) (privs) & 0xFFFF) | \
76  (((AclMode) (goptions) & 0xFFFF) << 16))
77 
78 
79 #define ACLITEM_ALL_PRIV_BITS ((AclMode) 0xFFFF)
80 #define ACLITEM_ALL_GOPTION_BITS ((AclMode) 0xFFFF << 16)
81 
82 /*
83  * Definitions for convenient access to Acl (array of AclItem).
84  * These are standard PostgreSQL arrays, but are restricted to have one
85  * dimension and no nulls. We also ignore the lower bound when reading,
86  * and set it to one when writing.
87  *
88  * CAUTION: as of PostgreSQL 7.1, these arrays are toastable (just like all
89  * other array types). Therefore, be careful to detoast them with the
90  * macros provided, unless you know for certain that a particular array
91  * can't have been toasted.
92  */
93 
94 
95 /*
96  * Acl a one-dimensional array of AclItem
97  */
98 typedef ArrayType Acl;
99 
100 #define ACL_NUM(ACL) (ARR_DIMS(ACL)[0])
101 #define ACL_DAT(ACL) ((AclItem *) ARR_DATA_PTR(ACL))
102 #define ACL_N_SIZE(N) (ARR_OVERHEAD_NONULLS(1) + ((N) * sizeof(AclItem)))
103 #define ACL_SIZE(ACL) ARR_SIZE(ACL)
104 
105 /*
106  * fmgr macros for these types
107  */
108 #define DatumGetAclItemP(X) ((AclItem *) DatumGetPointer(X))
109 #define PG_GETARG_ACLITEM_P(n) DatumGetAclItemP(PG_GETARG_DATUM(n))
110 #define PG_RETURN_ACLITEM_P(x) PG_RETURN_POINTER(x)
111 
112 #define DatumGetAclP(X) ((Acl *) PG_DETOAST_DATUM(X))
113 #define DatumGetAclPCopy(X) ((Acl *) PG_DETOAST_DATUM_COPY(X))
114 #define PG_GETARG_ACL_P(n) DatumGetAclP(PG_GETARG_DATUM(n))
115 #define PG_GETARG_ACL_P_COPY(n) DatumGetAclPCopy(PG_GETARG_DATUM(n))
116 #define PG_RETURN_ACL_P(x) PG_RETURN_POINTER(x)
117 
118 /*
119  * ACL modification opcodes for aclupdate
120  */
121 #define ACL_MODECHG_ADD 1
122 #define ACL_MODECHG_DEL 2
123 #define ACL_MODECHG_EQL 3
124 
125 /*
126  * External representations of the privilege bits --- aclitemin/aclitemout
127  * represent each possible privilege bit with a distinct 1-character code
128  */
129 #define ACL_INSERT_CHR 'a' /* formerly known as "append" */
130 #define ACL_SELECT_CHR 'r' /* formerly known as "read" */
131 #define ACL_UPDATE_CHR 'w' /* formerly known as "write" */
132 #define ACL_DELETE_CHR 'd'
133 #define ACL_TRUNCATE_CHR 'D' /* super-delete, as it were */
134 #define ACL_REFERENCES_CHR 'x'
135 #define ACL_TRIGGER_CHR 't'
136 #define ACL_EXECUTE_CHR 'X'
137 #define ACL_USAGE_CHR 'U'
138 #define ACL_CREATE_CHR 'C'
139 #define ACL_CREATE_TEMP_CHR 'T'
140 #define ACL_CONNECT_CHR 'c'
141 
142 /* string holding all privilege code chars, in order by bitmask position */
143 #define ACL_ALL_RIGHTS_STR "arwdDxtXUCTc"
144 
145 /*
146  * Bitmasks defining "all rights" for each supported object type
147  */
148 #define ACL_ALL_RIGHTS_COLUMN (ACL_INSERT|ACL_SELECT|ACL_UPDATE|ACL_REFERENCES)
149 #define ACL_ALL_RIGHTS_RELATION (ACL_INSERT|ACL_SELECT|ACL_UPDATE|ACL_DELETE|ACL_TRUNCATE|ACL_REFERENCES|ACL_TRIGGER)
150 #define ACL_ALL_RIGHTS_SEQUENCE (ACL_USAGE|ACL_SELECT|ACL_UPDATE)
151 #define ACL_ALL_RIGHTS_DATABASE (ACL_CREATE|ACL_CREATE_TEMP|ACL_CONNECT)
152 #define ACL_ALL_RIGHTS_FDW (ACL_USAGE)
153 #define ACL_ALL_RIGHTS_FOREIGN_SERVER (ACL_USAGE)
154 #define ACL_ALL_RIGHTS_FUNCTION (ACL_EXECUTE)
155 #define ACL_ALL_RIGHTS_LANGUAGE (ACL_USAGE)
156 #define ACL_ALL_RIGHTS_LARGEOBJECT (ACL_SELECT|ACL_UPDATE)
157 #define ACL_ALL_RIGHTS_NAMESPACE (ACL_USAGE|ACL_CREATE)
158 #define ACL_ALL_RIGHTS_TABLESPACE (ACL_CREATE)
159 #define ACL_ALL_RIGHTS_TYPE (ACL_USAGE)
160 
161 /* operation codes for pg_*_aclmask */
162 typedef enum
163 {
164  ACLMASK_ALL, /* normal case: compute all bits */
165  ACLMASK_ANY /* return when result is known nonzero */
166 } AclMaskHow;
167 
168 /* result codes for pg_*_aclcheck */
169 typedef enum
170 {
174 } AclResult;
175 
176 /* this enum covers all object types that can have privilege errors */
177 /* currently it's only used to tell aclcheck_error what to say */
178 typedef enum AclObjectKind
179 {
180  ACL_KIND_COLUMN, /* pg_attribute */
181  ACL_KIND_CLASS, /* pg_class */
182  ACL_KIND_SEQUENCE, /* pg_sequence */
183  ACL_KIND_DATABASE, /* pg_database */
184  ACL_KIND_PROC, /* pg_proc */
185  ACL_KIND_OPER, /* pg_operator */
186  ACL_KIND_TYPE, /* pg_type */
187  ACL_KIND_LANGUAGE, /* pg_language */
188  ACL_KIND_LARGEOBJECT, /* pg_largeobject */
189  ACL_KIND_NAMESPACE, /* pg_namespace */
190  ACL_KIND_OPCLASS, /* pg_opclass */
191  ACL_KIND_OPFAMILY, /* pg_opfamily */
192  ACL_KIND_COLLATION, /* pg_collation */
193  ACL_KIND_CONVERSION, /* pg_conversion */
194  ACL_KIND_TABLESPACE, /* pg_tablespace */
195  ACL_KIND_TSDICTIONARY, /* pg_ts_dict */
196  ACL_KIND_TSCONFIGURATION, /* pg_ts_config */
197  ACL_KIND_FDW, /* pg_foreign_data_wrapper */
198  ACL_KIND_FOREIGN_SERVER, /* pg_foreign_server */
199  ACL_KIND_EVENT_TRIGGER, /* pg_event_trigger */
200  ACL_KIND_EXTENSION, /* pg_extension */
201  MAX_ACL_KIND /* MUST BE LAST */
202 } AclObjectKind;
203 
204 
205 /*
206  * routines used internally
207  */
208 extern Acl *acldefault(GrantObjectType objtype, Oid ownerId);
209 extern Acl *get_user_default_acl(GrantObjectType objtype, Oid ownerId,
210  Oid nsp_oid);
211 
212 extern Acl *aclupdate(const Acl *old_acl, const AclItem *mod_aip,
213  int modechg, Oid ownerId, DropBehavior behavior);
214 extern Acl *aclnewowner(const Acl *old_acl, Oid oldOwnerId, Oid newOwnerId);
215 extern Acl *make_empty_acl(void);
216 extern Acl *aclcopy(const Acl *orig_acl);
217 extern Acl *aclconcat(const Acl *left_acl, const Acl *right_acl);
218 extern Acl *aclmerge(const Acl *left_acl, const Acl *right_acl, Oid ownerId);
219 extern void aclitemsort(Acl *acl);
220 extern bool aclequal(const Acl *left_acl, const Acl *right_acl);
221 
222 extern AclMode aclmask(const Acl *acl, Oid roleid, Oid ownerId,
223  AclMode mask, AclMaskHow how);
224 extern int aclmembers(const Acl *acl, Oid **roleids);
225 
226 extern bool has_privs_of_role(Oid member, Oid role);
227 extern bool is_member_of_role(Oid member, Oid role);
228 extern bool is_member_of_role_nosuper(Oid member, Oid role);
229 extern bool is_admin_of_role(Oid member, Oid role);
230 extern void check_is_member_of_role(Oid member, Oid role);
231 extern Oid get_role_oid(const char *rolename, bool missing_ok);
232 extern Oid get_role_oid_or_public(const char *rolename);
233 extern Oid get_rolespec_oid(const Node *node, bool missing_ok);
234 extern void check_rolespec_name(const Node *node, const char *detail_msg);
235 extern HeapTuple get_rolespec_tuple(const Node *node);
236 extern char *get_rolespec_name(const Node *node);
237 
238 extern void select_best_grantor(Oid roleId, AclMode privileges,
239  const Acl *acl, Oid ownerId,
240  Oid *grantorId, AclMode *grantOptions);
241 
242 extern void initialize_acl(void);
243 
244 /*
245  * SQL functions (from acl.c)
246  */
257 
258 /*
259  * prototypes for functions in aclchk.c
260  */
261 extern void ExecuteGrantStmt(GrantStmt *stmt);
263 
264 extern void RemoveRoleFromObjectACL(Oid roleid, Oid classid, Oid objid);
265 extern void RemoveDefaultACLById(Oid defaclOid);
266 
267 extern AclMode pg_attribute_aclmask(Oid table_oid, AttrNumber attnum,
268  Oid roleid, AclMode mask, AclMaskHow how);
269 extern AclMode pg_class_aclmask(Oid table_oid, Oid roleid,
270  AclMode mask, AclMaskHow how);
271 extern AclMode pg_database_aclmask(Oid db_oid, Oid roleid,
272  AclMode mask, AclMaskHow how);
273 extern AclMode pg_proc_aclmask(Oid proc_oid, Oid roleid,
274  AclMode mask, AclMaskHow how);
275 extern AclMode pg_language_aclmask(Oid lang_oid, Oid roleid,
276  AclMode mask, AclMaskHow how);
277 extern AclMode pg_largeobject_aclmask_snapshot(Oid lobj_oid, Oid roleid,
278  AclMode mask, AclMaskHow how, Snapshot snapshot);
279 extern AclMode pg_namespace_aclmask(Oid nsp_oid, Oid roleid,
280  AclMode mask, AclMaskHow how);
281 extern AclMode pg_tablespace_aclmask(Oid spc_oid, Oid roleid,
282  AclMode mask, AclMaskHow how);
283 extern AclMode pg_foreign_data_wrapper_aclmask(Oid fdw_oid, Oid roleid,
284  AclMode mask, AclMaskHow how);
285 extern AclMode pg_foreign_server_aclmask(Oid srv_oid, Oid roleid,
286  AclMode mask, AclMaskHow how);
287 extern AclMode pg_type_aclmask(Oid type_oid, Oid roleid,
288  AclMode mask, AclMaskHow how);
289 
290 extern AclResult pg_attribute_aclcheck(Oid table_oid, AttrNumber attnum,
291  Oid roleid, AclMode mode);
292 extern AclResult pg_attribute_aclcheck_all(Oid table_oid, Oid roleid,
293  AclMode mode, AclMaskHow how);
294 extern AclResult pg_class_aclcheck(Oid table_oid, Oid roleid, AclMode mode);
295 extern AclResult pg_database_aclcheck(Oid db_oid, Oid roleid, AclMode mode);
296 extern AclResult pg_proc_aclcheck(Oid proc_oid, Oid roleid, AclMode mode);
297 extern AclResult pg_language_aclcheck(Oid lang_oid, Oid roleid, AclMode mode);
298 extern AclResult pg_largeobject_aclcheck_snapshot(Oid lang_oid, Oid roleid,
299  AclMode mode, Snapshot snapshot);
300 extern AclResult pg_namespace_aclcheck(Oid nsp_oid, Oid roleid, AclMode mode);
301 extern AclResult pg_tablespace_aclcheck(Oid spc_oid, Oid roleid, AclMode mode);
302 extern AclResult pg_foreign_data_wrapper_aclcheck(Oid fdw_oid, Oid roleid, AclMode mode);
303 extern AclResult pg_foreign_server_aclcheck(Oid srv_oid, Oid roleid, AclMode mode);
304 extern AclResult pg_type_aclcheck(Oid type_oid, Oid roleid, AclMode mode);
305 
306 extern void aclcheck_error(AclResult aclerr, AclObjectKind objectkind,
307  const char *objectname);
308 
309 extern void aclcheck_error_col(AclResult aclerr, AclObjectKind objectkind,
310  const char *objectname, const char *colname);
311 
312 extern void aclcheck_error_type(AclResult aclerr, Oid typeOid);
313 
314 /* ownercheck routines just return true (owner) or false (not) */
315 extern bool pg_class_ownercheck(Oid class_oid, Oid roleid);
316 extern bool pg_type_ownercheck(Oid type_oid, Oid roleid);
317 extern bool pg_oper_ownercheck(Oid oper_oid, Oid roleid);
318 extern bool pg_proc_ownercheck(Oid proc_oid, Oid roleid);
319 extern bool pg_language_ownercheck(Oid lan_oid, Oid roleid);
320 extern bool pg_largeobject_ownercheck(Oid lobj_oid, Oid roleid);
321 extern bool pg_namespace_ownercheck(Oid nsp_oid, Oid roleid);
322 extern bool pg_tablespace_ownercheck(Oid spc_oid, Oid roleid);
323 extern bool pg_opclass_ownercheck(Oid opc_oid, Oid roleid);
324 extern bool pg_opfamily_ownercheck(Oid opf_oid, Oid roleid);
325 extern bool pg_database_ownercheck(Oid db_oid, Oid roleid);
326 extern bool pg_collation_ownercheck(Oid coll_oid, Oid roleid);
327 extern bool pg_conversion_ownercheck(Oid conv_oid, Oid roleid);
328 extern bool pg_ts_dict_ownercheck(Oid dict_oid, Oid roleid);
329 extern bool pg_ts_config_ownercheck(Oid cfg_oid, Oid roleid);
330 extern bool pg_foreign_data_wrapper_ownercheck(Oid srv_oid, Oid roleid);
331 extern bool pg_foreign_server_ownercheck(Oid srv_oid, Oid roleid);
332 extern bool pg_event_trigger_ownercheck(Oid et_oid, Oid roleid);
333 extern bool pg_extension_ownercheck(Oid ext_oid, Oid roleid);
334 extern bool has_createrole_privilege(Oid roleid);
335 extern bool has_bypassrls_privilege(Oid roleid);
336 
337 #endif /* ACL_H */
Oid ai_grantee
Definition: acl.h:48
AclResult pg_class_aclcheck(Oid table_oid, Oid roleid, AclMode mode)
Definition: aclchk.c:4405
bool pg_opclass_ownercheck(Oid opc_oid, Oid roleid)
Definition: aclchk.c:4758
void aclitemsort(Acl *acl)
Definition: acl.c:494
bool pg_oper_ownercheck(Oid oper_oid, Oid roleid)
Definition: aclchk.c:4581
bool aclequal(const Acl *left_acl, const Acl *right_acl)
Definition: acl.c:508
GrantObjectType
Definition: parsenodes.h:1588
bool pg_ts_config_ownercheck(Oid cfg_oid, Oid roleid)
Definition: aclchk.c:4839
Datum aclremove(PG_FUNCTION_ARGS)
Definition: acl.c:1543
AclResult pg_proc_aclcheck(Oid proc_oid, Oid roleid, AclMode mode)
Definition: aclchk.c:4429
void aclcheck_error_col(AclResult aclerr, AclObjectKind objectkind, const char *objectname, const char *colname)
Definition: aclchk.c:3417
bool pg_database_ownercheck(Oid db_oid, Oid roleid)
Definition: aclchk.c:4947
AclMode pg_tablespace_aclmask(Oid spc_oid, Oid roleid, AclMode mask, AclMaskHow how)
Definition: aclchk.c:4032
bool pg_language_ownercheck(Oid lan_oid, Oid roleid)
Definition: aclchk.c:4633
Acl * aclupdate(const Acl *old_acl, const AclItem *mod_aip, int modechg, Oid ownerId, DropBehavior behavior)
Definition: acl.c:914
AclMode pg_foreign_server_aclmask(Oid srv_oid, Oid roleid, AclMode mask, AclMaskHow how)
Definition: aclchk.c:4150
AclMode pg_type_aclmask(Oid type_oid, Oid roleid, AclMode mask, AclMaskHow how)
Definition: aclchk.c:4210
Datum aclitemout(PG_FUNCTION_ARGS)
Definition: acl.c:590
struct AclItem AclItem
Acl * aclnewowner(const Acl *old_acl, Oid oldOwnerId, Oid newOwnerId)
Definition: acl.c:1035
Datum makeaclitem(PG_FUNCTION_ARGS)
Definition: acl.c:1575
AclMode pg_class_aclmask(Oid table_oid, Oid roleid, AclMode mask, AclMaskHow how)
Definition: aclchk.c:3610
ArrayType Acl
Definition: acl.h:98
AclResult pg_largeobject_aclcheck_snapshot(Oid lang_oid, Oid roleid, AclMode mode, Snapshot snapshot)
Definition: aclchk.c:4453
AclMode pg_attribute_aclmask(Oid table_oid, AttrNumber attnum, Oid roleid, AclMode mask, AclMaskHow how)
Definition: aclchk.c:3525
AclResult pg_attribute_aclcheck(Oid table_oid, AttrNumber attnum, Oid roleid, AclMode mode)
Definition: aclchk.c:4291
bool pg_foreign_data_wrapper_ownercheck(Oid srv_oid, Oid roleid)
Definition: aclchk.c:4866
Definition: nodes.h:491
bool is_member_of_role_nosuper(Oid member, Oid role)
Definition: acl.c:4892
AclMode pg_foreign_data_wrapper_aclmask(Oid fdw_oid, Oid roleid, AclMode mask, AclMaskHow how)
Definition: aclchk.c:4089
AclResult pg_foreign_server_aclcheck(Oid srv_oid, Oid roleid, AclMode mode)
Definition: aclchk.c:4505
unsigned int Oid
Definition: postgres_ext.h:31
bool pg_extension_ownercheck(Oid ext_oid, Oid roleid)
Definition: aclchk.c:5025
Acl * aclcopy(const Acl *orig_acl)
Definition: acl.c:406
HeapTuple get_rolespec_tuple(const Node *node)
Definition: acl.c:5189
Oid ai_grantor
Definition: acl.h:49
bool has_createrole_privilege(Oid roleid)
Definition: aclchk.c:5075
char * get_rolespec_name(const Node *node)
Definition: acl.c:5238
bool pg_type_ownercheck(Oid type_oid, Oid roleid)
Definition: aclchk.c:4555
Datum aclcontains(PG_FUNCTION_ARGS)
Definition: acl.c:1553
bool pg_tablespace_ownercheck(Oid spc_oid, Oid roleid)
Definition: aclchk.c:4731
void ExecuteGrantStmt(GrantStmt *stmt)
Definition: aclchk.c:375
bool pg_conversion_ownercheck(Oid conv_oid, Oid roleid)
Definition: aclchk.c:4999
AclMode ai_privs
Definition: acl.h:50
Oid get_role_oid(const char *rolename, bool missing_ok)
Definition: acl.c:5113
uint32 AclMode
Definition: parsenodes.h:61
void select_best_grantor(Oid roleId, AclMode privileges, const Acl *acl, Oid ownerId, Oid *grantorId, AclMode *grantOptions)
Definition: acl.c:5038
Acl * get_user_default_acl(GrantObjectType objtype, Oid ownerId, Oid nsp_oid)
Definition: aclchk.c:5150
AclResult pg_tablespace_aclcheck(Oid spc_oid, Oid roleid, AclMode mode)
Definition: aclchk.c:4479
void aclcheck_error(AclResult aclerr, AclObjectKind objectkind, const char *objectname)
Definition: aclchk.c:3391
Datum hash_aclitem(PG_FUNCTION_ARGS)
Definition: acl.c:712
AclResult pg_database_aclcheck(Oid db_oid, Oid roleid, AclMode mode)
Definition: aclchk.c:4417
AclMode pg_namespace_aclmask(Oid nsp_oid, Oid roleid, AclMode mask, AclMaskHow how)
Definition: aclchk.c:3950
AclMode pg_language_aclmask(Oid lang_oid, Oid roleid, AclMode mask, AclMaskHow how)
Definition: aclchk.c:3814
AclResult pg_attribute_aclcheck_all(Oid table_oid, Oid roleid, AclMode mode, AclMaskHow how)
Definition: aclchk.c:4320
Datum aclitemin(PG_FUNCTION_ARGS)
Definition: acl.c:564
int aclmembers(const Acl *acl, Oid **roleids)
Definition: acl.c:1456
AclResult pg_language_aclcheck(Oid lang_oid, Oid roleid, AclMode mode)
Definition: aclchk.c:4441
void RemoveDefaultACLById(Oid defaclOid)
Definition: aclchk.c:1441
void aclcheck_error_type(AclResult aclerr, Oid typeOid)
Definition: aclchk.c:3449
AclMode pg_database_aclmask(Oid db_oid, Oid roleid, AclMode mask, AclMaskHow how)
Definition: aclchk.c:3706
bool pg_collation_ownercheck(Oid coll_oid, Oid roleid)
Definition: aclchk.c:4973
void check_rolespec_name(const Node *node, const char *detail_msg)
Definition: acl.c:5260
AclResult pg_namespace_aclcheck(Oid nsp_oid, Oid roleid, AclMode mode)
Definition: aclchk.c:4467
AclMode aclmask(const Acl *acl, Oid roleid, Oid ownerId, AclMode mask, AclMaskHow how)
Definition: acl.c:1304
bool is_admin_of_role(Oid member, Oid role)
Definition: acl.c:4912
DropBehavior
Definition: parsenodes.h:1445
bool pg_event_trigger_ownercheck(Oid et_oid, Oid roleid)
Definition: aclchk.c:4920
AclResult
Definition: acl.h:169
uintptr_t Datum
Definition: postgres.h:374
AclResult pg_foreign_data_wrapper_aclcheck(Oid fdw_oid, Oid roleid, AclMode mode)
Definition: aclchk.c:4492
Datum aclitem_eq(PG_FUNCTION_ARGS)
Definition: acl.c:692
bool pg_foreign_server_ownercheck(Oid srv_oid, Oid roleid)
Definition: aclchk.c:4893
void initialize_acl(void)
Definition: acl.c:4611
Definition: acl.h:46
AclResult pg_type_aclcheck(Oid type_oid, Oid roleid, AclMode mode)
Definition: aclchk.c:4517
AclMode pg_proc_aclmask(Oid proc_oid, Oid roleid, AclMode mask, AclMaskHow how)
Definition: aclchk.c:3760
AclMode pg_largeobject_aclmask_snapshot(Oid lobj_oid, Oid roleid, AclMode mask, AclMaskHow how, Snapshot snapshot)
Definition: aclchk.c:3877
Datum aclexplode(PG_FUNCTION_ARGS)
Definition: acl.c:1746
bool pg_ts_dict_ownercheck(Oid dict_oid, Oid roleid)
Definition: aclchk.c:4812
void ExecAlterDefaultPrivilegesStmt(AlterDefaultPrivilegesStmt *stmt)
Definition: aclchk.c:852
bool pg_opfamily_ownercheck(Oid opf_oid, Oid roleid)
Definition: aclchk.c:4785
Acl * acldefault(GrantObjectType objtype, Oid ownerId)
Definition: acl.c:731
void RemoveRoleFromObjectACL(Oid roleid, Oid classid, Oid objid)
Definition: aclchk.c:1316
AclMaskHow
Definition: acl.h:162
Oid get_rolespec_oid(const Node *node, bool missing_ok)
Definition: acl.c:5146
Oid get_role_oid_or_public(const char *rolename)
Definition: acl.c:5130
bool pg_proc_ownercheck(Oid proc_oid, Oid roleid)
Definition: aclchk.c:4607
bool has_bypassrls_privilege(Oid roleid)
Definition: aclchk.c:5094
Acl * make_empty_acl(void)
Definition: acl.c:397
#define PG_FUNCTION_ARGS
Definition: fmgr.h:150
AclObjectKind
Definition: acl.h:178
bool pg_class_ownercheck(Oid class_oid, Oid roleid)
Definition: aclchk.c:4529
bool is_member_of_role(Oid member, Oid role)
Definition: acl.c:4854
Acl * aclmerge(const Acl *left_acl, const Acl *right_acl, Oid ownerId)
Definition: acl.c:450
int16 AttrNumber
Definition: attnum.h:21
void check_is_member_of_role(Oid member, Oid role)
Definition: acl.c:4876
bool has_privs_of_role(Oid member, Oid role)
Definition: acl.c:4830
Datum acldefault_sql(PG_FUNCTION_ARGS)
Definition: acl.c:845
Datum aclinsert(PG_FUNCTION_ARGS)
Definition: acl.c:1533
bool pg_largeobject_ownercheck(Oid lobj_oid, Oid roleid)
Definition: aclchk.c:4662
bool pg_namespace_ownercheck(Oid nsp_oid, Oid roleid)
Definition: aclchk.c:4705
Acl * aclconcat(const Acl *left_acl, const Acl *right_acl)
Definition: acl.c:426