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:
KubeSphere CI Bot
2025-03-03 16:22:39 +08:00
committed by GitHub
parent 2ed005f1b1
commit 33152139d6

View File

@@ -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)
}