mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-10-30 08:16:23 +08:00
fix: permission verbs for adding/replacing labels are now "update" instead of "create"
This commit is contained in:
@@ -170,7 +170,7 @@ func (c *CronWorkflowServer) GetCronWorkflowLabels(ctx context.Context, req *api
|
||||
// If the label already exists, overwrites it.
|
||||
func (c *CronWorkflowServer) AddCronWorkflowLabels(ctx context.Context, req *api.AddLabelsRequest) (*api.GetLabelsResponse, error) {
|
||||
client := ctx.Value("kubeClient").(*v1.Client)
|
||||
allowed, err := auth.IsAuthorized(client, req.Namespace, "create", "argoproj.io", "cronworkflows", "")
|
||||
allowed, err := auth.IsAuthorized(client, req.Namespace, "update", "argoproj.io", "cronworkflows", "")
|
||||
if err != nil || !allowed {
|
||||
return nil, err
|
||||
}
|
||||
@@ -195,7 +195,7 @@ func (c *CronWorkflowServer) AddCronWorkflowLabels(ctx context.Context, req *api
|
||||
// Deletes all of the old labels and adds the new ones.
|
||||
func (c *CronWorkflowServer) ReplaceCronWorkflowLabels(ctx context.Context, req *api.ReplaceLabelsRequest) (*api.GetLabelsResponse, error) {
|
||||
client := ctx.Value("kubeClient").(*v1.Client)
|
||||
allowed, err := auth.IsAuthorized(client, req.Namespace, "create", "argoproj.io", "cronworkflows", "")
|
||||
allowed, err := auth.IsAuthorized(client, req.Namespace, "update", "argoproj.io", "cronworkflows", "")
|
||||
if err != nil || !allowed {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user