fix: During the creation of a workspace, it will be determined whethe… (#6387)
fix: During the creation of a workspace, it will be determined whethe… (#2147) * fix: During the creation of a workspace, it will be determined whether the user has the authority to designate other users as administrators. * fix: code update * fix: Determine whether the user is a workspace administrator based on whether the user has the permission to delete the workspace --------- Signed-off-by: peng wu <2030047311@qq.com> Co-authored-by: smartcat999 <49057502+smartcat999@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
2ed005f1b1
commit
33152139d6
@@ -431,6 +431,12 @@ func (t *tenantOperator) CreateWorkspaceTemplate(user user.Info, workspace *tena
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if workspace.Spec.Template.Spec.Manager != user.GetName() {
|
||||
if err := t.checkWorkspaceTemplatePermission(user, workspace.Name); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return workspace, t.client.Create(context.Background(), workspace)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user