diff --git a/api/service/organization_service.go b/api/service/organization_service.go index a042acc26..115a0378b 100644 --- a/api/service/organization_service.go +++ b/api/service/organization_service.go @@ -267,8 +267,10 @@ func (svc *OrganizationService) RemoveMember(id string, memberID string, userID return err } - if err := svc.orgGuard.Authorize(userID, org, model.PermissionOwner); err != nil { - return err + if memberID != userID { + if err := svc.orgGuard.Authorize(userID, org, model.PermissionOwner); err != nil { + return err + } } /* Make sure member is not the last remaining owner of the organization */ diff --git a/api/service/workspace_service.go b/api/service/workspace_service.go index febf9228e..01b24a23d 100644 --- a/api/service/workspace_service.go +++ b/api/service/workspace_service.go @@ -236,7 +236,7 @@ func (svc *WorkspaceService) PatchStorageCapacity(id string, storageCapacity int if err != nil { return nil, err } - if err = svc.workspaceGuard.Authorize(userID, workspace, model.PermissionEditor); err != nil { + if err = svc.workspaceGuard.Authorize(userID, workspace, model.PermissionOwner); err != nil { return nil, err } size, err := svc.fileRepo.ComputeSize(workspace.GetRootID())