Role restricted block is showing after role switch

Created on 18 July 2023, over 1 year ago
Updated 22 July 2023, over 1 year ago

Role restricted block is showing after role switch

Steps to reproduce this issue:

  • PFA, Add visibility roles restriction in Drupal block.
  • After that switch to one role from other using Masquerade Role. The restricted block is visible.

I faced this issue only in Masquerade Role switch. When I logged in directly the restricted block is not visible. Please let me know if you have any solution for this issue.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India cbuvaneswaran

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @cbuvaneswaran
  • Status changed to Postponed: needs info over 1 year ago
  • 🇧🇪Belgium RandalV

    Hi @cbuvaneswaran,

    It's possible the cache tag for that specific item needs to be cleared on changing roles, could you try adding the cache tag for that block to /admin/config/people/masquerade-role ?

    Let me know if this didn't help in the end.

    Changing the issue metadata accordingly.

  • 🇮🇳India cbuvaneswaran

    Hi @RandalV,

    Yes, I configured and tried the "external tags to invalidate" option, but I am still facing the same issue. PFA(tab_id.png & config_settings.png) the configuration screenshots.

    Regards,
    Buvaneswaran

  • Status changed to Needs work over 1 year ago
    • 3a37ce66 committed on 1.0.x
      Fix for #3375148: Role restricted block is showing after role switch
      
  • Status changed to Fixed over 1 year ago
  • 🇧🇪Belgium RandalV

    Hi @cbuvaneswaran,

    Thanks for reporting the issue and providing all the steps and valuable information.
    I was able to reproduce and solve the issue. Sadly, solving it wasn't possible without overwriting the User entity class, something I would've rather avoided.
    Beware of other modules that might also do this, because one might have precedence over the other and remove the changes the other one added.

    I've added a new release with this fix.

    Please, let me know if there's anything else or if the fix doesn't seem sufficient.
    From my tests, it works well now.

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

Production build 0.71.5 2024