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

  1. Don't give a certain role the permission "Administer entityqueue".
  2. Give that role the permission to "manipulate" a queue
  3. 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.

Command icon 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

artemboiko created an issue. See original summary.

artemboiko’s picture

Status: Active » Needs review
artemboiko’s picture

Also this is related to core fixes for checking access on listbuilders links

akalam made their first commit to this issue’s fork.

akalam’s picture

Thanks 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.

akalam’s picture

StatusFileSize
new6.56 KB

I'm uploading a static patch to apply from composer

artemboiko’s picture

Ok @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

akalam’s picture

Hi @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

artemboiko’s picture

Aha got it, makes sense.
Thanx for info @akalam

amateescu’s picture

Version: 8.x-1.7 » 8.x-1.x-dev
Status: Needs review » Postponed (maintainer needs more info)
Issue tags: -enable, -disable, -permission, -configure
Related issues: -#2650898: ListBuilders do not check $entity->access() for operation links +#3451509: Display only the operations the user has access to in subqueueListForEntity

I'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?

we have a bug with configure user don't have access to this page but still can see link on entityqueue list page

Also, what's the use case for a separate enable/disable permission? Is the general "update" permission not sufficient?

tonibarbera’s picture

StatusFileSize
new3 KB

Rerolled for the version 8.x-1.8

shivansunfire’s picture

Issue summary: View changes

> 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.

shivansunfire’s picture

Status: Postponed (maintainer needs more info) » Reviewed & tested by the community

Fixed 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.

shivansunfire’s picture

StatusFileSize
new4.27 KB

https://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.

amateescu’s picture

Category: Feature request » Task
Status: Reviewed & tested by the community » Fixed

I've read through the latest comments and I agree that having access to enable/disable queues through the update permission is problematic.

However, I think it's an advanced enough use-case that we can use the administer entityqueue permission 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!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.