/*------------------------------------------------------------------------- * * acl.h * Definition of (and support for) access control list data structures. * * * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * $Id: acl.h,v 1.35 2001/06/12 15:58:34 momjian Exp $ * * NOTES * For backward-compatibility purposes we have to allow there * to be a null ACL in a pg_class tuple. This will be defined as * meaning "default protection" (i.e., whatever acldefault() returns). * * The AclItems in an ACL array are currently kept in sorted order. * Things will break hard if you change that without changing the * code wherever this is included. *------------------------------------------------------------------------- */ #ifndef ACL_H #define ACL_H #include "nodes/parsenodes.h" #include "utils/array.h" #include "utils/memutils.h" /* * AclId system identifier for the user, group, etc. * XXX currently UNIX uid for users... */ typedef uint32 AclId; #define ACL_ID_WORLD 0 /* placeholder for id in a WORLD acl item */ /* * AclIdType tag that describes if the AclId is a user, group, etc. */ typedef uint8 AclIdType; #define ACL_IDTYPE_WORLD 0x00 #define ACL_IDTYPE_UID 0x01 /* user id - from pg_shadow */ #define ACL_IDTYPE_GID 0x02 /* group id - from pg_group */ /* * AclMode the actual permissions * XXX should probably use bit.h routines. * XXX should probably also stuff the modechg cruft in the * high bits, too. */ typedef uint8 AclMode; #define ACL_NO 0 /* no permissions */ #define ACL_INSERT (1<<0) #define ACL_SELECT (1<<1) #define ACL_UPDATE (1<<2) #define ACL_DELETE (1<<3) #define ACL_RULE (1<<4) #define ACL_REFERENCES (1<<5) #define ACL_TRIGGER (1<<6) #define N_ACL_MODES 7 /* 1 plus the last 1<