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`](crate::error::TeamsError::PermissionDenied) if the caller is not a workspace admin, or a n
(
client: &StorageClient,
workspace_slug: &str,
subject_type: GrantSubjectType,
subject_id: Uuid,
)
| 169 | /// if the caller is not a workspace admin, or a not-found error if the |
| 170 | /// workspace doesn't exist. |
| 171 | pub async fn revoke_workspace_grant( |
| 172 | client: &StorageClient, |
| 173 | workspace_slug: &str, |
| 174 | subject_type: GrantSubjectType, |
| 175 | subject_id: Uuid, |
| 176 | ) -> TeamsResult<()> { |
| 177 | let st = subject_type.to_string(); |
| 178 | let path = format!("/workspaces/{workspace_slug}/grants/{st}/{subject_id}"); |
| 179 | client |
| 180 | .delete(&path) |
| 181 | .await |
| 182 | .map_err(|e| map_remote_error(e, format!("workspace {workspace_slug}"))) |
| 183 | } |
| 184 | |
| 185 | // --------------------------------------------------------------------------- |
| 186 | // Tests |
no test coverage detected