MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / validate_mutation_subject

Function validate_mutation_subject

atomic-teams/src/grant.rs:33–40  ·  view source on GitHub ↗

Ensure a grant mutation targets a concrete user or team. `Everyone` is emitted by Storage when listing public grants, but the mutation endpoints require a non-null user or team UUID.

(subject_type: GrantSubjectType)

Source from the content-addressed store, hash-verified

31/// `Everyone` is emitted by Storage when listing public grants, but the
32/// mutation endpoints require a non-null user or team UUID.
33fn validate_mutation_subject(subject_type: GrantSubjectType) -> TeamsResult<()> {
34 match subject_type {
35 GrantSubjectType::User | GrantSubjectType::Team => Ok(()),
36 GrantSubjectType::Everyone => Err(TeamsError::InvalidInput(
37 "grant mutations require a user or team subject".to_string(),
38 )),
39 }
40}
41
42// ---------------------------------------------------------------------------
43// Organization grants

Callers 5

add_org_grantFunction · 0.85
revoke_org_grantFunction · 0.85
add_workspace_grantFunction · 0.85
revoke_workspace_grantFunction · 0.85

Calls

no outgoing calls

Tested by 1