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

Function generate_cluster_usage_privileges

src/sql/src/rbac.rs:1807–1825  ·  view source on GitHub ↗
(
    expr_is_const: bool,
    target_cluster_id: Option<ClusterId>,
    role_id: RoleId,
)

Source from the content-addressed store, hash-verified

1805}
1806
1807fn generate_cluster_usage_privileges(
1808 expr_is_const: bool,
1809 target_cluster_id: Option<ClusterId>,
1810 role_id: RoleId,
1811) -> Option<(SystemObjectId, AclMode, RoleId)> {
1812 // TODO(jkosh44) expr hasn't been fully optimized yet, so it might actually be a constant,
1813 // but we mistakenly think that it's not. For now it's ok to be overly protective.
1814 if !expr_is_const {
1815 if let Some(cluster_id) = target_cluster_id {
1816 return Some((
1817 SystemObjectId::Object(cluster_id.into()),
1818 AclMode::USAGE,
1819 role_id,
1820 ));
1821 }
1822 }
1823
1824 None
1825}
1826
1827fn check_object_privileges(
1828 catalog: &impl SessionCatalog,

Callers 1

Calls 1

ObjectClass · 0.50

Tested by

no test coverage detected