aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/acl.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2004-04-26 15:06:49 +0000
committerBruce Momjian <bruce@momjian.us>2004-04-26 15:06:49 +0000
commit0a17fd726ca50d04d99395addbbc89e6dfa5be31 (patch)
tree0d5617708f5b180622cbd279e92d6d0f2e1122da /src/backend/utils/adt/acl.c
parent9cb7b76ec7a3e6bb661550848a5dac6c9c0accbd (diff)
downloadpostgresql-0a17fd726ca50d04d99395addbbc89e6dfa5be31.tar.gz
postgresql-0a17fd726ca50d04d99395addbbc89e6dfa5be31.zip
Please find a attached a small patch that adds accessor functions
for "aclitem" so that it is not an opaque datatype. I needed these functions to browse aclitems from user land. I can load them when necessary, but it seems to me that these accessors for a backend type belong to the backend, so I submit them. Fabien Coelho
Diffstat (limited to 'src/backend/utils/adt/acl.c')
-rw-r--r--src/backend/utils/adt/acl.c39
1 files changed, 38 insertions, 1 deletions
diff --git a/src/backend/utils/adt/acl.c b/src/backend/utils/adt/acl.c
index 0404307d3ca..f206e806f43 100644
--- a/src/backend/utils/adt/acl.c
+++ b/src/backend/utils/adt/acl.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/acl.c,v 1.101 2003/11/29 19:51:57 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/acl.c,v 1.102 2004/04/26 15:06:48 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -874,6 +874,43 @@ makeaclitem(PG_FUNCTION_ARGS)
PG_RETURN_ACLITEM_P(aclitem);
}
+/* give access to internal data within aclitem
+ */
+Datum
+aclitem_grantee(PG_FUNCTION_ARGS)
+{
+ AclItem * a = PG_GETARG_ACLITEM_P(0);
+ PG_RETURN_INT32(a->ai_grantee);
+}
+
+Datum
+aclitem_grantor(PG_FUNCTION_ARGS)
+{
+ AclItem * a = PG_GETARG_ACLITEM_P(0);
+ PG_RETURN_INT32(a->ai_grantor);
+}
+
+Datum
+aclitem_idtype(PG_FUNCTION_ARGS)
+{
+ AclItem * a = PG_GETARG_ACLITEM_P(0);
+ PG_RETURN_INT32(ACLITEM_GET_IDTYPE(*a));
+}
+
+Datum
+aclitem_privs(PG_FUNCTION_ARGS)
+{
+ AclItem * a = PG_GETARG_ACLITEM_P(0);
+ PG_RETURN_INT32(ACLITEM_GET_PRIVS(*a));
+}
+
+Datum
+aclitem_goptions(PG_FUNCTION_ARGS)
+{
+ AclItem * a = PG_GETARG_ACLITEM_P(0);
+ PG_RETURN_INT32(ACLITEM_GET_GOPTIONS(*a));
+}
+
static AclMode
convert_priv_string(text *priv_type_text)
{