I'm setting up an "editor" role for a D8 site. They should be able to flush the cache so they can see their changes on the site. However, flushing the cache requires the "Administer site configuration" permission which would give an editor way more access to the site config than they need. I know I can override this with custom code but this seems like a pretty basic option that should be available "out of the box."

Comments

codesmith created an issue. See original summary.

Berdir’s picture

Admin toolbar provides direct cache flush operations, not sure what kind of access it uses.

> They should be able to flush the cache so they can see their changes on the site.

I kind of disagree with this because of the that shouldn't be necessary in the first place. With cache tags, any change that an editor can make should automatically invalidate all relevant caches. Anything else is a bug IMHO.

If you have specific things that require you to do a cache clear then I'd suggest you open bug reports about those and reference them here.

codesmith’s picture

Thanks for the clarification. So if new content is added, will that invalidate the cache tag in a view that displays the content?

Berdir’s picture

Yes, that should happen. Try that on a very simple D8 site like a default D8 installation with the fronpage or another view.

If it's not working on a specific site then it might be a configuration issue although this isn't something that you should be able to break with configuration.

codesmith’s picture

Status: Active » Closed (works as designed)
alfattal’s picture

The Admin Toolbar provide cache flushing feature only to administrators. So, it is not a solution.

chuck_theobald’s picture

Thinking this should be part of out-of-the-box Drupal. One example where this would be useful is in breadcrumbs. Changes that would modify the breadcrumb for a page are not effective until the cache clears out. For intance, a content manager can add a new level to breadcrumb paths with changes to URL aliases, but they have no way of seeing this take effect without having an admin flush the caches.

For now, it looks like leymannx's contribution https://www.drupal.org/project/rebuild_cache_access is the answer.