fix: During the creation of a workspace, it will be determined whethe… (#6385)

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>
This commit is contained in:
smartcat999
2025-03-03 16:11:39 +08:00
committed by GitHub
parent f77b0afd85
commit 2ed83e77d4

View File

@@ -437,6 +437,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) return workspace, t.client.Create(context.Background(), workspace)
} }