New "clear caches" permission

Created on 21 September 2018, over 5 years ago
Updated 24 April 2024, about 2 months ago

Problem/Motivation

Clearing the caches in Drupal is something that needs to be done for different purposes and not always is an administrator task.

Right now there is no specific permission for "flush" the caches, so many modules rely on "administer site configuration" permission.

I think it could be useful to have a specific permission "clear caches" where other modules can rely on.

Proposed resolution

Create only a permission to allow to clear the caches
or
Create a permission per cache type to allow to clear each cache type.

Remaining tasks

Discuss about the better solution
Create the patch

User interface changes

A new permission(s) will be created.

API changes

None.

Data model changes

None.

✨ Feature request
Status

Closed: works as designed

Version

11.0 πŸ”₯

Component
SystemΒ  β†’

Last updated 1 day ago

No maintainer
Created by

πŸ‡ͺπŸ‡ΈSpain TuWebO

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    So should this be closed?

  • Status changed to Closed: works as designed 11 months ago
  • πŸ‡ΊπŸ‡ΈUnited States cilefen
  • πŸ‡«πŸ‡·France ericdsd France

    Hi IMHO clearing cache would deserve its own permission and even if a contrib module does it, it seems a bit overkill to require a module for that.
    It's indeed a quite common request, and i don't see any technical drawback to create a dedicated permission, we could easilly even manage the BC change with an update hook giving this new permission to every user that has administer site configuration permission.

    Concerning creating a permission per cache type, i'm not sure it is really usefull though and is more a edge case.

  • πŸ‡«πŸ‡·France ericdsd France

    Don't you think this issue is worth being reopened, as it's a real need for some people and it's neither complicated to fix nor bringing backward compatibility issue.
    https://www.drupal.org/project/rebuild_cache_access β†’ module is helping but forces to have a big button in the toolbar that doesn't fit for everybody. If i'm not the only one to think this let me know.

  • πŸ‡ΊπŸ‡ΈUnited States cilefen

    The popular (300k installs), https://www.drupal.org/project/admin_toolbar β†’ , also has this.

  • πŸ‡«πŸ‡·France ericdsd France

    Hi @Cilefen as far as i know, admin Toolbar only provides cache rebuild link if you have access to it and doesn't provide any specific permission or settings to bypass it.
    Note on the project i most need this functionality admin toolbar is installed. My concern is that i don't want to grant Administer site configuration permission tu some users that might need to access to cache rebuild functionnality. Let me know if i missed something in admin Toolbar though.

  • πŸ‡ΊπŸ‡ΈUnited States tenten71

    I am looking for a solution to adding a cache rebuild link to my custom menu.

    Everything I've found so far relies on the Admin Toolbar module. It may be popular but it does not fit all needs. It may be popular because no one has offered something in its place.

    Drupal is meant to be customizable and the permissions are meant to be granular.

    If I could code my own solution, I would. Maybe in time.

Production build 0.69.0 2024