With the changes introduced in this issue: #3357181: Does not react to role changes, any role change shows a prompt to any user about rebuilding permissions.

We have a few processes on our site that mean that non-admin users can effectively change their own roles. For example, they purchase a membership, so they gain the "member" role upon payment.

These users are receiving a "rebuild permissions" prompt that they don't understand or have the ability to act upon.

I think the warning should only be shown to users who can access the URL the link points towards. If the warning isn't shown, it should be put in the logs instead. (Or better yet: always logged and, when the user can do it, also shown in a message.)

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

samalander created an issue. See original summary.

samalander’s picture

Version: 8.x-1.x-dev » 2.0.x-dev

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

gisle’s picture

Status: Active » Needs review

Spiffy, thanks for the MR! We need someone using the module and who is bitten by this review it.

spfaffly’s picture

@gisle You're welcome.

I've come across a similar issue and figured this would be the best approach.

This MR basically has a check if the current user has the permission of "access administration pages" and displays that message accordingly.

Any users that don't have this permission won't see this message.

andre.bonon’s picture

StatusFileSize
new1.15 KB

Hi, I've experienced the same issue with the message being displayed to users who don't have permissions to rebuild permissions. I'm going to apply the patch and let you know if it works.
I'm attaching a patch file from the diff so we can use it with composer.

andre.bonon’s picture

Status: Needs review » Reviewed & tested by the community

The fix works for me.

gisle’s picture

Issue summary: View changes

Linked to related issue.

  • gisle committed 034414bb on 2.0.x authored by spfaffly
    Issue #3392037: Rebuild permission warning shouldn't be shown to users...
gisle’s picture

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

Committed to the most recent snapshot of 2.0.x-dev.

Status: Fixed » Closed (fixed)

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

vipul tulse’s picture

@gisle Guys any plan to release new version with this issue fixed

stolzenhain’s picture

Strangely, this patch would still show the message to users who definitely weren't being able to access the admin/rebuild page.

gisle’s picture

Status: Closed (fixed) » Needs work

Reopening, based upon #14.

stolzenhain’s picture

Status: Needs work » Fixed

Hello @gisle – thanks for checking on this – the reason we still saw the message was us using Rules successor ECA which switches users for role operation permissions (as seen in the demo feature) – effectively receiving the message while in a temporary admin state.

We fixed this by applying a local patch that removes the message output.

Status: Fixed » Closed (fixed)

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

jalipit2’s picture

@stolzenhain I have nearly the exact same scenario as you using ECA to switch user roles in a temp admin state. Would you mind sharing the patch?