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-2017, 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 "parser/parse_node.h"
30 #include "utils/array.h"
31 #include "utils/snapshot.h"
32 
33 
34 /*
35  * typedef AclMode is declared in parsenodes.h, also the individual privilege
36  * bit meanings are defined there
37  */
38 
39 #define ACL_ID_PUBLIC 0 /* placeholder for id in a PUBLIC acl item */
40 
41 /*
42  * AclItem
43  *
44  * Note: must be same size on all platforms, because the size is hardcoded
45  * in the pg_type.h entry for aclitem.
46  */
47 typedef struct AclItem
48 {
49  Oid ai_grantee; /* ID that this item grants privs to */
50  Oid ai_grantor; /* grantor of privs */
51  AclMode ai_privs; /* privilege bits */
52 } AclItem;
53 
54 /*
55  * The upper 16 bits of the ai_privs field of an AclItem are the grant option
56  * bits, and the lower 16 bits are the actual privileges. We use "rights"
57  * to mean the combined grant option and privilege bits fields.
58  */
59 #define ACLITEM_GET_PRIVS(item) ((item).ai_privs & 0xFFFF)
60 #define ACLITEM_GET_GOPTIONS(item) (((item).ai_privs >> 16) & 0xFFFF)
61 #define ACLITEM_GET_RIGHTS(item) ((item).ai_privs)
62 
63 #define ACL_GRANT_OPTION_FOR(privs) (((AclMode) (privs) & 0xFFFF) << 16)
64 #define ACL_OPTION_TO_PRIVS(privs) (((AclMode) (privs) >> 16) & 0xFFFF)
65 
66 #define ACLITEM_SET_PRIVS(item,privs) \
67  ((item).ai_privs = ((item).ai_privs & ~((AclMode) 0xFFFF)) | \
68  ((AclMode) (privs) & 0xFFFF))
69 #define ACLITEM_SET_GOPTIONS(item,goptions) \
70  ((item).ai_privs = ((item).ai_privs & ~(((AclMode) 0xFFFF) << 16)) | \
71  (((AclMode) (goptions) & 0xFFFF) << 16))
72 #define ACLITEM_SET_RIGHTS(item,rights) \
73  ((item).ai_privs = (AclMode) (rights))
74 
75 #define ACLITEM_SET_PRIVS_GOPTIONS(item,privs,goptions) \
76  ((item).ai_privs = ((AclMode) (privs) & 0xFFFF) | \
77  (((AclMode) (goptions) & 0xFFFF) << 16))
78 
79 
80 #define ACLITEM_ALL_PRIV_BITS ((AclMode) 0xFFFF)
81 #define ACLITEM_ALL_GOPTION_BITS ((AclMode) 0xFFFF << 16)
82 
83 /*
84  * Definitions for convenient access to Acl (array of AclItem).
85  * These are standard PostgreSQL arrays, but are restricted to have one
86  * dimension and no nulls. We also ignore the lower bound when reading,
87  * and set it to one when writing.
88  *
89  * CAUTION: as of PostgreSQL 7.1, these arrays are toastable (just like all
90  * other array types). Therefore, be careful to detoast them with the
91  * macros provided, unless you know for certain that a particular array
92  * can't have been toasted.
93  */
94 
95 
96 /*
97  * Acl a one-dimensional array of AclItem
98  */
99 typedef ArrayType Acl;
100 
101 #define ACL_NUM(ACL) (ARR_DIMS(ACL)[0])
102 #define ACL_DAT(ACL) ((AclItem *) ARR_DATA_PTR(ACL))
103 #define ACL_N_SIZE(N) (ARR_OVERHEAD_NONULLS(1) + ((N) * sizeof(AclItem)))
104 #define ACL_SIZE(ACL) ARR_SIZE(ACL)
105 
106 /*
107  * fmgr macros for these types
108  */
109 #define DatumGetAclItemP(X) ((AclItem *) DatumGetPointer(X))
110 #define PG_GETARG_ACLITEM_P(n) DatumGetAclItemP(PG_GETARG_DATUM(n))
111 #define PG_RETURN_ACLITEM_P(x) PG_RETURN_POINTER(x)
112 
113 #define DatumGetAclP(X) ((Acl *) PG_DETOAST_DATUM(X))
114 #define DatumGetAclPCopy(X) ((Acl *) PG_DETOAST_DATUM_COPY(X))
115 #define PG_GETARG_ACL_P(n) DatumGetAclP(PG_GETARG_DATUM(n))
116 #define PG_GETARG_ACL_P_COPY(n) DatumGetAclPCopy(PG_GETARG_DATUM(n))
117 #define PG_RETURN_ACL_P(x) PG_RETURN_POINTER(x)
118 
119 /*
120  * ACL modification opcodes for aclupdate
121  */
122 #define ACL_MODECHG_ADD 1
123 #define ACL_MODECHG_DEL 2
124 #define ACL_MODECHG_EQL 3
125 
126 /*
127  * External representations of the privilege bits --- aclitemin/aclitemout
128  * represent each possible privilege bit with a distinct 1-character code
129  */
130 #define ACL_INSERT_CHR 'a' /* formerly known as "append" */
131 #define ACL_SELECT_CHR 'r' /* formerly known as "read" */
132 #define ACL_UPDATE_CHR 'w' /* formerly known as "write" */
133 #define ACL_DELETE_CHR 'd'
134 #define ACL_TRUNCATE_CHR 'D' /* super-delete, as it were */
135 #define ACL_REFERENCES_CHR 'x'
136 #define ACL_TRIGGER_CHR 't'
137 #define ACL_EXECUTE_CHR 'X'
138 #define ACL_USAGE_CHR 'U'
139 #define ACL_CREATE_CHR 'C'
140 #define ACL_CREATE_TEMP_CHR 'T'
141 #define ACL_CONNECT_CHR 'c'
142 
143 /* string holding all privilege code chars, in order by bitmask position */
144 #define ACL_ALL_RIGHTS_STR "arwdDxtXUCTc"
145 
146 /*
147  * Bitmasks defining "all rights" for each supported object type
148  */
149 #define ACL_ALL_RIGHTS_COLUMN (ACL_INSERT|ACL_SELECT|ACL_UPDATE|ACL_REFERENCES)
150 #define ACL_ALL_RIGHTS_RELATION (ACL_INSERT|ACL_SELECT|ACL_UPDATE|ACL_DELETE|ACL_TRUNCATE|ACL_REFERENCES|ACL_TRIGGER)
151 #define ACL_ALL_RIGHTS_SEQUENCE (ACL_USAGE|ACL_SELECT|ACL_UPDATE)
152 #define ACL_ALL_RIGHTS_DATABASE (ACL_CREATE|ACL_CREATE_TEMP|ACL_CONNECT)
153 #define ACL_ALL_RIGHTS_FDW (ACL_USAGE)
154 #define ACL_ALL_RIGHTS_FOREIGN_SERVER (ACL_USAGE)
155 #define ACL_ALL_RIGHTS_FUNCTION (ACL_EXECUTE)
156 #define ACL_ALL_RIGHTS_LANGUAGE (ACL_USAGE)
157 #define ACL_ALL_RIGHTS_LARGEOBJECT (ACL_SELECT|ACL_UPDATE)
158 #define ACL_ALL_RIGHTS_NAMESPACE (ACL_USAGE|ACL_CREATE)
159 #define ACL_ALL_RIGHTS_TABLESPACE (ACL_CREATE)
160 #define ACL_ALL_RIGHTS_TYPE (ACL_USAGE)
161 
162 /* operation codes for pg_*_aclmask */
163 typedef enum
164 {
165  ACLMASK_ALL, /* normal case: compute all bits */
166  ACLMASK_ANY /* return when result is known nonzero */
167 } AclMaskHow;
168 
169 /* result codes for pg_*_aclcheck */
170 typedef enum
171 {
175 } AclResult;
176 
177 /* this enum covers all object types that can have privilege errors */
178 /* currently it's only used to tell aclcheck_error what to say */
179 typedef enum AclObjectKind
180 {
181  ACL_KIND_COLUMN, /* pg_attribute */
182  ACL_KIND_CLASS, /* pg_class */
183  ACL_KIND_SEQUENCE, /* pg_sequence */
184  ACL_KIND_DATABASE, /* pg_database */
185  ACL_KIND_PROC, /* pg_proc */
186  ACL_KIND_OPER, /* pg_operator */
187  ACL_KIND_TYPE, /* pg_type */
188  ACL_KIND_LANGUAGE, /* pg_language */
189  ACL_KIND_LARGEOBJECT, /* pg_largeobject */
190  ACL_KIND_NAMESPACE, /* pg_namespace */
191  ACL_KIND_OPCLASS, /* pg_opclass */
192  ACL_KIND_OPFAMILY, /* pg_opfamily */
193  ACL_KIND_COLLATION, /* pg_collation */
194  ACL_KIND_CONVERSION, /* pg_conversion */
195  ACL_KIND_STATISTICS, /* pg_statistic_ext */
196  ACL_KIND_TABLESPACE, /* pg_tablespace */
197  ACL_KIND_TSDICTIONARY, /* pg_ts_dict */
198  ACL_KIND_TSCONFIGURATION, /* pg_ts_config */
199  ACL_KIND_FDW, /* pg_foreign_data_wrapper */
200  ACL_KIND_FOREIGN_SERVER, /* pg_foreign_server */
201  ACL_KIND_EVENT_TRIGGER, /* pg_event_trigger */
202  ACL_KIND_EXTENSION, /* pg_extension */
203  ACL_KIND_PUBLICATION, /* pg_publication */
204  ACL_KIND_SUBSCRIPTION, /* pg_subscription */
205  MAX_ACL_KIND /* MUST BE LAST */
206 } AclObjectKind;
207 
208 
209 /*
210  * routines used internally
211  */
212 extern Acl *acldefault(GrantObjectType objtype, Oid ownerId);
213 extern Acl *get_user_default_acl(GrantObjectType objtype, Oid ownerId,
214  Oid nsp_oid);
215 
216 extern Acl *aclupdate(const Acl *old_acl, const AclItem *mod_aip,
217  int modechg, Oid ownerId, DropBehavior behavior);
218 extern Acl *aclnewowner(const Acl *old_acl, Oid oldOwnerId, Oid newOwnerId);
219 extern Acl *make_empty_acl(void);
220 extern Acl *aclcopy(const Acl *orig_acl);
221 extern Acl *aclconcat(const Acl *left_acl, const Acl *right_acl);
222 extern Acl *aclmerge(const Acl *left_acl, const Acl *right_acl, Oid ownerId);
223 extern void aclitemsort(Acl *acl);
224 extern bool aclequal(const Acl *left_acl, const Acl *right_acl);
225 
226 extern AclMode aclmask(const Acl *acl, Oid roleid, Oid ownerId,
227  AclMode mask, AclMaskHow how);
228 extern int aclmembers(const Acl *acl, Oid **roleids);
229 
230 extern bool has_privs_of_role(Oid member, Oid role);
231 extern bool is_member_of_role(Oid member, Oid role);
232 extern bool is_member_of_role_nosuper(Oid member, Oid role);
233 extern bool is_admin_of_role(Oid member, Oid role);
234 extern void check_is_member_of_role(Oid member, Oid role);
235 extern Oid get_role_oid(const char *rolename, bool missing_ok);
236 extern Oid get_role_oid_or_public(const char *rolename);
237 extern Oid get_rolespec_oid(const RoleSpec *role, bool missing_ok);
238 extern void check_rolespec_name(const RoleSpec *role, const char *detail_msg);
239 extern HeapTuple get_rolespec_tuple(const RoleSpec *role);
240 extern char *get_rolespec_name(const RoleSpec *role);
241 
242 extern void select_best_grantor(Oid roleId, AclMode privileges,
243  const Acl *acl, Oid ownerId,
244  Oid *grantorId, AclMode *grantOptions);
245 
246 extern void initialize_acl(void);
247 
248 /*
249  * prototypes for functions in aclchk.c
250  */
251 extern void ExecuteGrantStmt(GrantStmt *stmt);
253 
254 extern void RemoveRoleFromObjectACL(Oid roleid, Oid classid, Oid objid);
255 extern void RemoveDefaultACLById(Oid defaclOid);
256 
257 extern AclMode pg_attribute_aclmask(Oid table_oid, AttrNumber attnum,
258  Oid roleid, AclMode mask, AclMaskHow how);
259 extern AclMode pg_class_aclmask(Oid table_oid, Oid roleid,
260  AclMode mask, AclMaskHow how);
261 extern AclMode pg_database_aclmask(Oid db_oid, Oid roleid,
262  AclMode mask, AclMaskHow how);
263 extern AclMode pg_proc_aclmask(Oid proc_oid, Oid roleid,
264  AclMode mask, AclMaskHow how);
265 extern AclMode pg_language_aclmask(Oid lang_oid, Oid roleid,
266  AclMode mask, AclMaskHow how);
267 extern AclMode pg_largeobject_aclmask_snapshot(Oid lobj_oid, Oid roleid,
268  AclMode mask, AclMaskHow how, Snapshot snapshot);
269 extern AclMode pg_namespace_aclmask(Oid nsp_oid, Oid roleid,
270  AclMode mask, AclMaskHow how);
271 extern AclMode pg_tablespace_aclmask(Oid spc_oid, Oid roleid,
272  AclMode mask, AclMaskHow how);
273 extern AclMode pg_foreign_data_wrapper_aclmask(Oid fdw_oid, Oid roleid,
274  AclMode mask, AclMaskHow how);
275 extern AclMode pg_foreign_server_aclmask(Oid srv_oid, Oid roleid,
276  AclMode mask, AclMaskHow how);
277 extern AclMode pg_type_aclmask(Oid type_oid, Oid roleid,
278  AclMode mask, AclMaskHow how);
279 
280 extern AclResult pg_attribute_aclcheck(Oid table_oid, AttrNumber attnum,
281  Oid roleid, AclMode mode);
282 extern AclResult pg_attribute_aclcheck_all(Oid table_oid, Oid roleid,
283  AclMode mode, AclMaskHow how);
284 extern AclResult pg_class_aclcheck(Oid table_oid, Oid roleid, AclMode mode);
285 extern AclResult pg_database_aclcheck(Oid db_oid, Oid roleid, AclMode mode);
286 extern AclResult pg_proc_aclcheck(Oid proc_oid, Oid roleid, AclMode mode);
287 extern AclResult pg_language_aclcheck(Oid lang_oid, Oid roleid, AclMode mode);
288 extern AclResult pg_largeobject_aclcheck_snapshot(Oid lang_oid, Oid roleid,
289  AclMode mode, Snapshot snapshot);
290 extern AclResult pg_namespace_aclcheck(Oid nsp_oid, Oid roleid, AclMode mode);
291 extern AclResult pg_tablespace_aclcheck(Oid spc_oid, Oid roleid, AclMode mode);
292 extern AclResult pg_foreign_data_wrapper_aclcheck(Oid fdw_oid, Oid roleid, AclMode mode);
293 extern AclResult pg_foreign_server_aclcheck(Oid srv_oid, Oid roleid, AclMode mode);
294 extern AclResult pg_type_aclcheck(Oid type_oid, Oid roleid, AclMode mode);
295 
296 extern void aclcheck_error(AclResult aclerr, AclObjectKind objectkind,
297  const char *objectname);
298 
299 extern void aclcheck_error_col(AclResult aclerr, AclObjectKind objectkind,
300  const char *objectname, const char *colname);
301 
302 extern void aclcheck_error_type(AclResult aclerr, Oid typeOid);
303 
304 extern void recordExtObjInitPriv(Oid objoid, Oid classoid);
305 extern void removeExtObjInitPriv(Oid objoid, Oid classoid);
306 
307 
308 /* ownercheck routines just return true (owner) or false (not) */
309 extern bool pg_class_ownercheck(Oid class_oid, Oid roleid);
310 extern bool pg_type_ownercheck(Oid type_oid, Oid roleid);
311 extern bool pg_oper_ownercheck(Oid oper_oid, Oid roleid);
312 extern bool pg_proc_ownercheck(Oid proc_oid, Oid roleid);
313 extern bool pg_language_ownercheck(Oid lan_oid, Oid roleid);
314 extern bool pg_largeobject_ownercheck(Oid lobj_oid, Oid roleid);
315 extern bool pg_namespace_ownercheck(Oid nsp_oid, Oid roleid);
316 extern bool pg_tablespace_ownercheck(Oid spc_oid, Oid roleid);
317 extern bool pg_opclass_ownercheck(Oid opc_oid, Oid roleid);
318 extern bool pg_opfamily_ownercheck(Oid opf_oid, Oid roleid);
319 extern bool pg_database_ownercheck(Oid db_oid, Oid roleid);
320 extern bool pg_collation_ownercheck(Oid coll_oid, Oid roleid);
321 extern bool pg_conversion_ownercheck(Oid conv_oid, Oid roleid);
322 extern bool pg_ts_dict_ownercheck(Oid dict_oid, Oid roleid);
323 extern bool pg_ts_config_ownercheck(Oid cfg_oid, Oid roleid);
324 extern bool pg_foreign_data_wrapper_ownercheck(Oid srv_oid, Oid roleid);
325 extern bool pg_foreign_server_ownercheck(Oid srv_oid, Oid roleid);
326 extern bool pg_event_trigger_ownercheck(Oid et_oid, Oid roleid);
327 extern bool pg_extension_ownercheck(Oid ext_oid, Oid roleid);
328 extern bool pg_publication_ownercheck(Oid pub_oid, Oid roleid);
329 extern bool pg_subscription_ownercheck(Oid sub_oid, Oid roleid);
330 extern bool pg_statistics_object_ownercheck(Oid stat_oid, Oid roleid);
331 extern bool has_createrole_privilege(Oid roleid);
332 extern bool has_bypassrls_privilege(Oid roleid);
333 
334 #endif /* ACL_H */
Oid ai_grantee
Definition: acl.h:49
AclResult pg_class_aclcheck(Oid table_oid, Oid roleid, AclMode mode)
Definition: aclchk.c:4422
bool pg_opclass_ownercheck(Oid opc_oid, Oid roleid)
Definition: aclchk.c:4775
void aclitemsort(Acl *acl)
Definition: acl.c:494
bool pg_oper_ownercheck(Oid oper_oid, Oid roleid)
Definition: aclchk.c:4598
bool aclequal(const Acl *left_acl, const Acl *right_acl)
Definition: acl.c:508
GrantObjectType
Definition: parsenodes.h:1831
bool pg_ts_config_ownercheck(Oid cfg_oid, Oid roleid)
Definition: aclchk.c:4856
AclResult pg_proc_aclcheck(Oid proc_oid, Oid roleid, AclMode mode)
Definition: aclchk.c:4446
void aclcheck_error_col(AclResult aclerr, AclObjectKind objectkind, const char *objectname, const char *colname)
Definition: aclchk.c:3425
bool pg_database_ownercheck(Oid db_oid, Oid roleid)
Definition: aclchk.c:4964
AclMode pg_tablespace_aclmask(Oid spc_oid, Oid roleid, AclMode mask, AclMaskHow how)
Definition: aclchk.c:4044
bool pg_language_ownercheck(Oid lan_oid, Oid roleid)
Definition: aclchk.c:4650
bool pg_publication_ownercheck(Oid pub_oid, Oid roleid)
Definition: aclchk.c:5084
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:4163
AclMode pg_type_aclmask(Oid type_oid, Oid roleid, AclMode mask, AclMaskHow how)
Definition: aclchk.c:4224
struct AclItem AclItem
Acl * aclnewowner(const Acl *old_acl, Oid oldOwnerId, Oid newOwnerId)
Definition: acl.c:1035
AclMode pg_class_aclmask(Oid table_oid, Oid roleid, AclMode mask, AclMaskHow how)
Definition: aclchk.c:3622
ArrayType Acl
Definition: acl.h:99
AclResult pg_largeobject_aclcheck_snapshot(Oid lang_oid, Oid roleid, AclMode mode, Snapshot snapshot)
Definition: aclchk.c:4470
AclMode pg_attribute_aclmask(Oid table_oid, AttrNumber attnum, Oid roleid, AclMode mask, AclMaskHow how)
Definition: aclchk.c:3537
AclResult pg_attribute_aclcheck(Oid table_oid, AttrNumber attnum, Oid roleid, AclMode mode)
Definition: aclchk.c:4308
bool pg_foreign_data_wrapper_ownercheck(Oid srv_oid, Oid roleid)
Definition: aclchk.c:4883
Oid get_rolespec_oid(const RoleSpec *role, bool missing_ok)
Definition: acl.c:5129
bool pg_statistics_object_ownercheck(Oid stat_oid, Oid roleid)
Definition: aclchk.c:5136
bool is_member_of_role_nosuper(Oid member, Oid role)
Definition: acl.c:4875
void ExecAlterDefaultPrivilegesStmt(ParseState *pstate, AlterDefaultPrivilegesStmt *stmt)
Definition: aclchk.c:863
AclMode pg_foreign_data_wrapper_aclmask(Oid fdw_oid, Oid roleid, AclMode mask, AclMaskHow how)
Definition: aclchk.c:4101
AclResult pg_foreign_server_aclcheck(Oid srv_oid, Oid roleid, AclMode mode)
Definition: aclchk.c:4522
unsigned int Oid
Definition: postgres_ext.h:31
bool pg_extension_ownercheck(Oid ext_oid, Oid roleid)
Definition: aclchk.c:5042
Acl * aclcopy(const Acl *orig_acl)
Definition: acl.c:406
Oid ai_grantor
Definition: acl.h:50
bool has_createrole_privilege(Oid roleid)
Definition: aclchk.c:5171
void removeExtObjInitPriv(Oid objoid, Oid classoid)
Definition: aclchk.c:5617
bool pg_type_ownercheck(Oid type_oid, Oid roleid)
Definition: aclchk.c:4572
bool pg_tablespace_ownercheck(Oid spc_oid, Oid roleid)
Definition: aclchk.c:4748
void ExecuteGrantStmt(GrantStmt *stmt)
Definition: aclchk.c:385
bool pg_conversion_ownercheck(Oid conv_oid, Oid roleid)
Definition: aclchk.c:5016
AclMode ai_privs
Definition: acl.h:51
Oid get_role_oid(const char *rolename, bool missing_ok)
Definition: acl.c:5096
uint32 AclMode
Definition: parsenodes.h:70
void select_best_grantor(Oid roleId, AclMode privileges, const Acl *acl, Oid ownerId, Oid *grantorId, AclMode *grantOptions)
Definition: acl.c:5021
Acl * get_user_default_acl(GrantObjectType objtype, Oid ownerId, Oid nsp_oid)
Definition: aclchk.c:5246
AclResult pg_tablespace_aclcheck(Oid spc_oid, Oid roleid, AclMode mode)
Definition: aclchk.c:4496
void aclcheck_error(AclResult aclerr, AclObjectKind objectkind, const char *objectname)
Definition: aclchk.c:3399
AclResult pg_database_aclcheck(Oid db_oid, Oid roleid, AclMode mode)
Definition: aclchk.c:4434
AclMode pg_namespace_aclmask(Oid nsp_oid, Oid roleid, AclMode mask, AclMaskHow how)
Definition: aclchk.c:3962
AclMode pg_language_aclmask(Oid lang_oid, Oid roleid, AclMode mask, AclMaskHow how)
Definition: aclchk.c:3826
AclResult pg_attribute_aclcheck_all(Oid table_oid, Oid roleid, AclMode mode, AclMaskHow how)
Definition: aclchk.c:4337
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:4458
void RemoveDefaultACLById(Oid defaclOid)
Definition: aclchk.c:1468
bool pg_subscription_ownercheck(Oid sub_oid, Oid roleid)
Definition: aclchk.c:5110
void aclcheck_error_type(AclResult aclerr, Oid typeOid)
Definition: aclchk.c:3457
void recordExtObjInitPriv(Oid objoid, Oid classoid)
Definition: aclchk.c:5328
AclMode pg_database_aclmask(Oid db_oid, Oid roleid, AclMode mask, AclMaskHow how)
Definition: aclchk.c:3718
bool pg_collation_ownercheck(Oid coll_oid, Oid roleid)
Definition: aclchk.c:4990
AclResult pg_namespace_aclcheck(Oid nsp_oid, Oid roleid, AclMode mode)
Definition: aclchk.c:4484
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:4895
DropBehavior
Definition: parsenodes.h:1672
bool pg_event_trigger_ownercheck(Oid et_oid, Oid roleid)
Definition: aclchk.c:4937
AclResult
Definition: acl.h:170
AclResult pg_foreign_data_wrapper_aclcheck(Oid fdw_oid, Oid roleid, AclMode mode)
Definition: aclchk.c:4509
bool pg_foreign_server_ownercheck(Oid srv_oid, Oid roleid)
Definition: aclchk.c:4910
void initialize_acl(void)
Definition: acl.c:4594
Definition: acl.h:47
AclResult pg_type_aclcheck(Oid type_oid, Oid roleid, AclMode mode)
Definition: aclchk.c:4534
AclMode pg_proc_aclmask(Oid proc_oid, Oid roleid, AclMode mask, AclMaskHow how)
Definition: aclchk.c:3772
AclMode pg_largeobject_aclmask_snapshot(Oid lobj_oid, Oid roleid, AclMode mask, AclMaskHow how, Snapshot snapshot)
Definition: aclchk.c:3889
bool pg_ts_dict_ownercheck(Oid dict_oid, Oid roleid)
Definition: aclchk.c:4829
bool pg_opfamily_ownercheck(Oid opf_oid, Oid roleid)
Definition: aclchk.c:4802
char * get_rolespec_name(const RoleSpec *role)
Definition: acl.c:5211
Acl * acldefault(GrantObjectType objtype, Oid ownerId)
Definition: acl.c:731
void RemoveRoleFromObjectACL(Oid roleid, Oid classid, Oid objid)
Definition: aclchk.c:1340
AclMaskHow
Definition: acl.h:163
Oid get_role_oid_or_public(const char *rolename)
Definition: acl.c:5113
bool pg_proc_ownercheck(Oid proc_oid, Oid roleid)
Definition: aclchk.c:4624
bool has_bypassrls_privilege(Oid roleid)
Definition: aclchk.c:5190
void check_rolespec_name(const RoleSpec *role, const char *detail_msg)
Definition: acl.c:5233
Acl * make_empty_acl(void)
Definition: acl.c:397
AclObjectKind
Definition: acl.h:179
bool pg_class_ownercheck(Oid class_oid, Oid roleid)
Definition: aclchk.c:4546
bool is_member_of_role(Oid member, Oid role)
Definition: acl.c:4837
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:4859
bool has_privs_of_role(Oid member, Oid role)
Definition: acl.c:4813
HeapTuple get_rolespec_tuple(const RoleSpec *role)
Definition: acl.c:5167
bool pg_largeobject_ownercheck(Oid lobj_oid, Oid roleid)
Definition: aclchk.c:4679
bool pg_namespace_ownercheck(Oid nsp_oid, Oid roleid)
Definition: aclchk.c:4722
Acl * aclconcat(const Acl *left_acl, const Acl *right_acl)
Definition: acl.c:426