fix(task): update the permission checked in CreateTask
CreateTasks now check that the user has the write permission to the tasks resource belonging to an organization. This change comes after https://github.com/influxdata/platform/pull/2157 modified the structure of authorization.pull/10616/head
parent
ead4a0a170
commit
ad75185629
|
@ -37,7 +37,7 @@ func NewValidator(ts platform.TaskService, bs platform.BucketService) platform.T
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ts *taskServiceValidator) CreateTask(ctx context.Context, t *platform.Task) error {
|
func (ts *taskServiceValidator) CreateTask(ctx context.Context, t *platform.Task) error {
|
||||||
p, err := platform.NewPermissionAtID(t.ID, platform.WriteAction, platform.TasksResource)
|
p, err := platform.NewPermissionAtID(t.Organization, platform.WriteAction, platform.TasksResource)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue