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

Function revoke_org_grant

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

Revoke all grants for a subject on an organization. Calls `DELETE /orgs/{slug}/grants/{subject_type}/{subject_id}`. The server removes **all** relations (read, write, admin, owner) for that subject in a single call. # Errors Returns [`TeamsError::OrgNotFound`] if the org does not exist, or [`TeamsError::PermissionDenied`] if the caller is not an org owner. Returns [`TeamsError::InvalidInput`] w

(
    client: &StorageClient,
    org_slug: &str,
    subject_type: GrantSubjectType,
    subject_id: Uuid,
)

Source from the content-addressed store, hash-verified

110/// [`TeamsError::InvalidInput`] when
111/// `subject_type` is [`GrantSubjectType::Everyone`].
112pub async fn revoke_org_grant(
113 client: &StorageClient,
114 org_slug: &str,
115 subject_type: GrantSubjectType,
116 subject_id: Uuid,
117) -> TeamsResult<()> {
118 validate_mutation_subject(subject_type)?;
119 let st = subject_type.to_string();
120 let path = format!("/orgs/{org_slug}/grants/{st}/{subject_id}");
121 client
122 .delete(&path)
123 .await
124 .map_err(|e| map_remote_error(e, format!("org {org_slug}")))
125}
126
127// ---------------------------------------------------------------------------
128// Workspace grants

Callers

nothing calls this directly

Calls 3

map_remote_errorFunction · 0.85
deleteMethod · 0.45

Tested by

no test coverage detected