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:
@@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user