Skip to content

Commit

Permalink
Fix of the last PR comments
Browse files Browse the repository at this point in the history
Signed-off-by: David Festal <[email protected]>
  • Loading branch information
davidfestal committed Jun 29, 2022
1 parent 5a5cffb commit 6c5ff37
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/virtual/workspaces/registry/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,14 @@ func (s *REST) authorizeForUser(ctx context.Context, orgClusterName logicalclust
if err := s.deprecatedAuthorizeOrgForUser(ctx, orgClusterName, user, "access"); err != nil {
return err
}
// Let's fall through here:
// if access to the current org workspace is granted (old permission model),
// we still need to check the `delete` permission for the workspace we want to delete
default:
klog.Errorf("Verb %q not supported in the case of a workspace living in a top-level organization", verb)
return kerrors.NewForbidden(tenancyv1beta1.Resource("workspaces"), resourceName, fmt.Errorf("%q workspace %q in workspace %q is not allowed", verb, resourceName, orgClusterName))
}

}

// check for <verb> permission on the ClusterWorkspace workspace subresource for the <resourceName>
Expand Down

0 comments on commit 6c5ff37

Please sign in to comment.