MCPcopy Create free account
hub / github.com/apache/cloudberry / sepgsql_attribute_drop

Function sepgsql_attribute_drop

contrib/sepgsql/relation.c:132–156  ·  view source on GitHub ↗

* sepgsql_attribute_drop * * It checks privileges to drop the supplied column. */

Source from the content-addressed store, hash-verified

130 * It checks privileges to drop the supplied column.
131 */
132void
133sepgsql_attribute_drop(Oid relOid, AttrNumber attnum)
134{
135 ObjectAddress object;
136 char *audit_name;
137 char relkind = get_rel_relkind(relOid);
138
139 if (relkind != RELKIND_RELATION && relkind != RELKIND_PARTITIONED_TABLE)
140 return;
141
142 /*
143 * check db_column:{drop} permission
144 */
145 object.classId = RelationRelationId;
146 object.objectId = relOid;
147 object.objectSubId = attnum;
148 audit_name = getObjectIdentity(&object, false);
149
150 sepgsql_avc_check_perms(&object,
151 SEPG_CLASS_DB_COLUMN,
152 SEPG_DB_COLUMN__DROP,
153 audit_name,
154 true);
155 pfree(audit_name);
156}
157
158/*
159 * sepgsql_attribute_relabel

Callers 1

sepgsql_object_accessFunction · 0.85

Calls 4

get_rel_relkindFunction · 0.85
getObjectIdentityFunction · 0.85
sepgsql_avc_check_permsFunction · 0.85
pfreeFunction · 0.50

Tested by

no test coverage detected