aclchk_internal.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*-------------------------------------------------------------------------
  2. *
  3. * aclchk_internal.h
  4. *
  5. * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
  6. * Portions Copyright (c) 1994, Regents of the University of California
  7. *
  8. * src/include/utils/aclchk_internal.h
  9. *
  10. *-------------------------------------------------------------------------
  11. */
  12. #ifndef ACLCHK_INTERNAL_H
  13. #define ACLCHK_INTERNAL_H
  14. #include "nodes/parsenodes.h"
  15. #include "nodes/pg_list.h"
  16. /*
  17. * The information about one Grant/Revoke statement, in internal format: object
  18. * and grantees names have been turned into Oids, the privilege list is an
  19. * AclMode bitmask. If 'privileges' is ACL_NO_RIGHTS (the 0 value) and
  20. * all_privs is true, 'privileges' will be internally set to the right kind of
  21. * ACL_ALL_RIGHTS_*, depending on the object type (NB - this will modify the
  22. * InternalGrant struct!)
  23. *
  24. * Note: 'all_privs' and 'privileges' represent object-level privileges only.
  25. * There might also be column-level privilege specifications, which are
  26. * represented in col_privs (this is a list of untransformed AccessPriv nodes).
  27. * Column privileges are only valid for objtype OBJECT_TABLE.
  28. */
  29. typedef struct
  30. {
  31. bool is_grant;
  32. ObjectType objtype;
  33. List *objects;
  34. bool all_privs;
  35. AclMode privileges;
  36. List *col_privs;
  37. List *grantees;
  38. bool grant_option;
  39. DropBehavior behavior;
  40. } InternalGrant;
  41. #endif /* ACLCHK_INTERNAL_H */