Skip to content

Use user permission attributes on worker creation and updates

https://redmine.teklia.com/issues/8012

Requires #1823 (closed)

Yet another boolean attribute should be added: User.can_manage_workers. It has the same rules as all the other attributes added in #1823 (closed). A data migration can set can_manage_workers to be equal to can_create_worker_version for now, because that's the closest info we have.

New security requirements are added to the worker creation and update endpoints:

  • CreateWorker now requires User.can_create_worker_version.

  • CreateWorkerVersion now requires User.can_create_worker_version, on top of requiring admin access to the worker.

  • UpdateWorker and PartialUpdateWorker now both require User.can_manage_workers, on top of requiring admin access to the worker instead of contributor access.

    Only requiring contributor access means any user with execution access to a worker can rename it or archive it. Only requiring admin access means any user on Community Edition can still rename or archive. Only requiring User.can_manage_workers means any user on Enterprise Edition with the permission can edit any worker! We do need both an admin right and the can_manage_workers attribute.

Please update the API docs to mention those requirements!