Problem/Motivation
We don't have permission for disabling access to enable and disable operation of entity, also we have a bug with configure user don't have access to this page but still can see link on entityqueue list page.
Steps to reproduce
- Don't give a certain role the permission "Administer entityqueue".
- Give that role the permission to "manipulate" a queue
- Users with that role will see the "Configure" action for that queue, however, they can't access the corresponding page to configure it. They shouldn't see the "Configure" operation.
Let's say we want a user not to be able to disable an entity queue, but we want to allow them to edit, add, remove and alter the order of the items of that queue. There is no way to achieve that, since "manipulate ... queue" is the permission required for both things.
Proposed resolution
1. Added permissions for enabling disabling operation.
2. Hide configure link on building links.
User interface changes
New permissions are provided for enable and disable.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | 3396136-15.patch | 4.27 KB | shivansunfire |
| #12 | 3396136-12.patch | 3 KB | tonibarbera |
Issue fork entityqueue-3396136
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
artemboikoComment #4
artemboikoAlso this is related to core fixes for checking access on listbuilders links
Comment #6
akalam commentedThanks for the MR @artemboiko! I'm still seeing the links for the operations which the user don't have access on the "Entity Queue" tab on entities, so I'm adding a new commit to fix it.
In the commit I'm checking the access to the url instead of checking the access to the entity operation. That's because the access could had been extended by other modules (like the group_entityqueue for example or custom access requirements) and by checking the access to the url will work properly on all scenarios.
Comment #7
akalam commentedI'm uploading a static patch to apply from composer
Comment #8
artemboikoOk @akalam thanx, btw you can use patch from MR in gitlab :)
We have a link to the patch in Code > Download > Patches > https://git.drupalcode.org/project/entityqueue/-/merge_requests/20.patch
Comment #9
akalam commentedHi @artemboiko the problem with patches from MR is that they are dynamic, they are generated automatically from the MR and the MR can change at anytime. It can lead on your site being deployed introducing untested code, or even the patch not applying without prior notification. There's a big discussion on this topic on the following issue: #3204538: GitLab Merge Requests Unable to Generate Incremental Patch Files
Comment #10
artemboikoAha got it, makes sense.
Thanx for info @akalam
Comment #11
amateescu commentedI've moved @akalam's commit into a separate issue: #3451509: Display only the operations the user has access to in subqueueListForEntity
@artemboiko, can you please write some steps to reproduce for this part?
Also, what's the use case for a separate enable/disable permission? Is the general "update" permission not sufficient?
Comment #12
tonibarbera commentedRerolled for the version 8.x-1.8
Comment #13
shivansunfire commented> can you please write some steps to reproduce for this part?
"we have a bug with configure user don't have access to this page but still can see link on entityqueue list page"
If a role doesn't get the permission "Administer entityqueue", but it does get the permission to "manipulate" the queue, then users with that role will see the "Configure" action for that queue, however, they can't access the corresponding page to configure it. They shouldn't see the "Configure" operation.
> Also, what's the use case for a separate enable/disable permission? Is the general "update" permission not sufficient?
Is not sufficient, because we could allow them just to edit the queue, so they can alter the order of the elements, add, edit, or delete those items. That doesn't imply configuration changes. However, with manipulate queue permission gives them the ability to "Disable" the queue itself, and we might not give them that permission, which actually does generates a configuration change which would imply a change in the config files and in the repository.
Comment #14
shivansunfire commentedFixed and updated Merge request.
Now granting "Manipulate all queues" permissions would be equal to granting one by one all "Manipulate ... queue", which means just edit the items in the queue (and doesn't produce config changes); not delete, not enable/disable, not configure.
So this last adjustment also adds the "Delete ... queue" permissions and removes access with just "Manipulate all queues", requiring those specific enable/disable or delete permissions, since those are more dangerous actions for the site and also would produce changes in configuration.
In summary, for example now editor users (non developers) would be able to manipulate the items of a queue without granting them the possibility of disabling or deleting the queue, which is a very common needed use case.
Comment #15
shivansunfire commentedhttps://git.drupalcode.org/project/entityqueue/-/merge_requests/20.diff patch doesn't apply to latest release 8.x-1.9, so I am uploading the patch re-rolled for this last release version.
Comment #16
amateescu commentedI've read through the latest comments and I agree that having access to enable/disable queues through the
updatepermission is problematic.However, I think it's an advanced enough use-case that we can use the
administer entityqueuepermission instead of adding a new one. Updated the MR to do that and also fixed a few other things.Merged into 8.x-1.x, thanks for all the work on this!