MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / check_owner_roles

Function check_owner_roles

src/sql/src/rbac.rs:1638–1648  ·  view source on GitHub ↗

Reports whether any role has ownership over an object.

(
    object_id: &ObjectId,
    role_ids: &BTreeSet<RoleId>,
    catalog: &impl SessionCatalog,
)

Source from the content-addressed store, hash-verified

1636
1637/// Reports whether any role has ownership over an object.
1638fn check_owner_roles(
1639 object_id: &ObjectId,
1640 role_ids: &BTreeSet<RoleId>,
1641 catalog: &impl SessionCatalog,
1642) -> bool {
1643 if let Some(owner_id) = catalog.get_owner_id(object_id) {
1644 role_ids.contains(&owner_id)
1645 } else {
1646 true
1647 }
1648}
1649
1650fn ownership_err(
1651 unheld_ownership: Vec<ObjectId>,

Callers 1

validateMethod · 0.85

Calls 2

get_owner_idMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected