Revoke all grants for a subject on a workspace. Calls `DELETE /workspaces/{slug}/grants/{subject_type}/{subject_id}`. The server removes **all** relations (read, write, admin) for that subject in a single call — no need to specify which relation to revoke. # Errors Returns [`TeamsError::PermissionDenied`] if the caller is not a workspace admin, or a not-found error if the workspace doesn't exis
(
client: &StorageClient,
workspace_slug: &str,
subject_type: GrantSubjectType,
subject_id: Uuid,
)
| 193 | /// [`TeamsError::InvalidInput`] when |
| 194 | /// `subject_type` is [`GrantSubjectType::Everyone`]. |
| 195 | pub async fn revoke_workspace_grant( |
| 196 | client: &StorageClient, |
| 197 | workspace_slug: &str, |
| 198 | subject_type: GrantSubjectType, |
| 199 | subject_id: Uuid, |
| 200 | ) -> TeamsResult<()> { |
| 201 | validate_mutation_subject(subject_type)?; |
| 202 | let st = subject_type.to_string(); |
| 203 | let path = format!("/workspaces/{workspace_slug}/grants/{st}/{subject_id}"); |
| 204 | client |
| 205 | .delete(&path) |
| 206 | .await |
| 207 | .map_err(|e| map_remote_error(e, format!("workspace {workspace_slug}"))) |
| 208 | } |
| 209 | |
| 210 | // --------------------------------------------------------------------------- |
| 211 | // Tests |
no test coverage detected