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 requiresUser.can_create_worker_version
. -
CreateWorkerVersion
now requiresUser.can_create_worker_version
, on top of requiring admin access to the worker. -
UpdateWorker
andPartialUpdateWorker
now both requireUser.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 thecan_manage_workers
attribute.
Please update the API docs to mention those requirements!