summaryrefslogtreecommitdiff
path: root/src/include/utils/acl.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-05-11 17:36:13 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-05-11 17:36:13 +0000
commit5ddbe904c0f6d0dc67597b43b7823cc54300b638 (patch)
treee7e292be13bda61ebec0deee0e8ee4d4b2f85580 /src/include/utils/acl.h
parentf739deb50fbcc4c275f2d90daa2bd997ff9d0c7c (diff)
Refactor low-level aclcheck code to provide useful interfaces for multi-bit
permissions tests in about the same amount of code as before. Exactly what the GRANT/REVOKE code ought to be doing is still up for debate, but this should be helpful in any case, and it already solves an efficiency problem in executor startup.
Diffstat (limited to 'src/include/utils/acl.h')
-rw-r--r--src/include/utils/acl.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/include/utils/acl.h b/src/include/utils/acl.h
index 4fcec230ccb..59131122cbc 100644
--- a/src/include/utils/acl.h
+++ b/src/include/utils/acl.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/acl.h,v 1.68 2004/05/02 13:38:28 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/utils/acl.h,v 1.69 2004/05/11 17:36:13 tgl Exp $
*
* NOTES
* An ACL array is simply an array of AclItems, representing the union
@@ -177,6 +177,12 @@ typedef ArrayType IdList;
#define ACL_ALL_RIGHTS_LANGUAGE (ACL_USAGE)
#define ACL_ALL_RIGHTS_NAMESPACE (ACL_USAGE|ACL_CREATE)
+/* operation codes for pg_*_aclmask */
+typedef enum
+{
+ ACLMASK_ALL, /* normal case: compute all bits */
+ ACLMASK_ANY /* return when result is known nonzero */
+} AclMaskHow;
/* result codes for pg_*_aclcheck */
typedef enum
@@ -228,6 +234,17 @@ extern void ExecuteGrantStmt(GrantStmt *stmt);
extern AclId get_grosysid(char *groname);
extern char *get_groname(AclId grosysid);
+extern AclMode pg_class_aclmask(Oid table_oid, AclId userid,
+ AclMode mask, AclMaskHow how);
+extern AclMode pg_database_aclmask(Oid db_oid, AclId userid,
+ AclMode mask, AclMaskHow how);
+extern AclMode pg_proc_aclmask(Oid proc_oid, AclId userid,
+ AclMode mask, AclMaskHow how);
+extern AclMode pg_language_aclmask(Oid lang_oid, AclId userid,
+ AclMode mask, AclMaskHow how);
+extern AclMode pg_namespace_aclmask(Oid nsp_oid, AclId userid,
+ AclMode mask, AclMaskHow how);
+
extern AclResult pg_class_aclcheck(Oid table_oid, AclId userid, AclMode mode);
extern AclResult pg_database_aclcheck(Oid db_oid, AclId userid, AclMode mode);
extern AclResult pg_proc_aclcheck(Oid proc_oid, AclId userid, AclMode mode);