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

Function sepgsql_attribute_setattr

contrib/sepgsql/relation.c:208–232  ·  view source on GitHub ↗

* sepgsql_attribute_setattr * * It checks privileges to alter the supplied column. */

Source from the content-addressed store, hash-verified

206 * It checks privileges to alter the supplied column.
207 */
208void
209sepgsql_attribute_setattr(Oid relOid, AttrNumber attnum)
210{
211 ObjectAddress object;
212 char *audit_name;
213 char relkind = get_rel_relkind(relOid);
214
215 if (relkind != RELKIND_RELATION && relkind != RELKIND_PARTITIONED_TABLE)
216 return;
217
218 /*
219 * check db_column:{setattr} permission
220 */
221 object.classId = RelationRelationId;
222 object.objectId = relOid;
223 object.objectSubId = attnum;
224 audit_name = getObjectIdentity(&object, false);
225
226 sepgsql_avc_check_perms(&object,
227 SEPG_CLASS_DB_COLUMN,
228 SEPG_DB_COLUMN__SETATTR,
229 audit_name,
230 true);
231 pfree(audit_name);
232}
233
234/*
235 * sepgsql_relation_post_create

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