Add Separate permission to flush the cache using admin toolbar

Created on 8 April 2025, about 1 month ago

Add a separate permission that allows users to flush the user cache without requiring the 'administer site configuration' permission.

Feature request
Status

Needs review

Version

3.5

Component

Code

Created by

🇯🇴Jordan Qusai Taha Amman

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

Merge Requests

Comments & Activities

  • Issue created by @Qusai Taha
  • First commit to issue fork.
  • 🇧🇪Belgium kevinvb

    Provided the changes as a MR.
    Also the patch couldn't apply when I tried it to install with composer, the MR did work.
    I added it and I could easily give the flush permission to eg a webmaster role.

  • Pipeline finished with Failed
    12 days ago
    Total: 329s
    #484705
  • 🇫🇷France dydave

    Thanks everyone for the contribution!

    Is this something we would really like to do?
    As you can see this change is breaking Tests, since an important permission is added for existing module's routes.
    See the permission used in the Tests: 'administer site configuration'
    https://git.drupalcode.org/project/admin_toolbar/-/blob/3.x/admin_toolba...

    This change could most likely break certain sites in the sense: certain roles might not have access to these routes anymore, after updating the module with this feature.
    So it does not seem like a trivial feature to add... 😅

    At the minimum, we would probably need to add a hook_update implementation to add the permission to any roles with the 'administer site configuration' permission, so the module's features stay the same on existing sites (after an update).

    Additionally, there should most likely be ways to add permissions for these routes, for any particular project, with alter hooks or route subscribers, etc... So this patch should not be absolutely necessary to achieve the same results.

    Overall, I'm not opposed to this feature, but a little worried of the impact it could have on the module compared to the benefits it could bring.

    I'm leaving this in Needs review for now, to see if more feedback could be provided and whether more interest could be shown by users for this feature.

    Thanks in advance for your comments and feedback! 🙂

Production build 0.71.5 2024