summaryrefslogtreecommitdiff
path: root/contrib/sepgsql/schema.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2012-03-09 15:18:45 -0500
committerRobert Haas <rhaas@postgresql.org>2012-03-09 15:18:45 -0500
commite914a144d3aaa0a09e0aab031d7e6f58389401ce (patch)
tree09d5d2c29e546764eb0562067ab3359ce2e4f9d6 /contrib/sepgsql/schema.c
parent07d1edb954bc8f5d0e2c010dec8482328af38cb8 (diff)
sepgsql DROP support.
KaiGai Kohei
Diffstat (limited to 'contrib/sepgsql/schema.c')
-rw-r--r--contrib/sepgsql/schema.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/contrib/sepgsql/schema.c b/contrib/sepgsql/schema.c
index 90dca1d6a75..31d60efe185 100644
--- a/contrib/sepgsql/schema.c
+++ b/contrib/sepgsql/schema.c
@@ -97,6 +97,33 @@ sepgsql_schema_post_create(Oid namespaceId)
}
/*
+ * sepgsql_schema_drop
+ *
+ * It checks privileges to drop the supplied schema object.
+ */
+void
+sepgsql_schema_drop(Oid namespaceId)
+{
+ ObjectAddress object;
+ char *audit_name;
+
+ /*
+ * check db_schema:{drop} permission
+ */
+ object.classId = NamespaceRelationId;
+ object.objectId = namespaceId;
+ object.objectSubId = 0;
+ audit_name = getObjectDescription(&object);
+
+ sepgsql_avc_check_perms(&object,
+ SEPG_CLASS_DB_SCHEMA,
+ SEPG_DB_SCHEMA__DROP,
+ audit_name,
+ true);
+ pfree(audit_name);
+}
+
+/*
* sepgsql_schema_relabel
*
* It checks privileges to relabel the supplied schema