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
Michael Desa 2019-01-09 10:36:25 -05:00
parent ead4a0a170
commit ad75185629
1 changed files with 1 additions and 1 deletions

View File

@ -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 {
p, err := platform.NewPermissionAtID(t.ID, platform.WriteAction, platform.TasksResource)
p, err := platform.NewPermissionAtID(t.Organization, platform.WriteAction, platform.TasksResource)
if err != nil {
return err
}