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

Function revoke_org_grant

atomic-teams/src/grant.rs:94–106  ·  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`](crate::error::TeamsError::OrgNotFound) if the org does not exist, or [`TeamsError::PermissionDenied`](crate::error::TeamsError::Permissi

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

Source from the content-addressed store, hash-verified

92/// [`TeamsError::PermissionDenied`](crate::error::TeamsError::PermissionDenied)
93/// if the caller is not an org owner.
94pub async fn revoke_org_grant(
95 client: &StorageClient,
96 org_slug: &str,
97 subject_type: GrantSubjectType,
98 subject_id: Uuid,
99) -> TeamsResult<()> {
100 let st = subject_type.to_string();
101 let path = format!("/orgs/{org_slug}/grants/{st}/{subject_id}");
102 client
103 .delete(&path)
104 .await
105 .map_err(|e| map_remote_error(e, format!("org {org_slug}")))
106}
107
108// ---------------------------------------------------------------------------
109// Workspace grants

Callers

nothing calls this directly

Calls 2

map_remote_errorFunction · 0.85
deleteMethod · 0.45

Tested by

no test coverage detected