After running into a number of problems I noticed after changing the permission of a node, the access restriction does not update without flushing the cache as well

This problem does not occur with the D7 version of node access

CommentFileSizeAuthor
#3 2962423-3.patch634 bytesweseze

Comments

MrPaulDriver created an issue. See original summary.

mrpauldriver’s picture

Title: After amending the permission of a node, the access restriction does not update without flushing the cache » Why is it necessary to flush the cache after amending the permission of a node for changes in the access restriction(s) to take effect?
Category: Bug report » Support request

Digging deeper, it seems that clearing either 'routing and links cache' or the 'views cache', fixes the issue. I don't know anything about routing and links, so any pointers to help my understanding would be appreciated.

Why the 'views cache' does has the effect when viewing a simple node with no views - I can not fathom!

I can foresee problems for site editors making changes to node access restrictions and failing to understand why they have not taken effect.

Is there something I can do so that permission changes take effect immediately?

----
EDIT

Should clarify that cache clearing seems necessary when granting/revoke access to a role. However clearing caches is not necessary for grants to individual users

weseze’s picture

StatusFileSize
new634 bytes

I experienced the same problem with roles. Although it did not always happen...

The attached patch fixes it for me.

elusivemind’s picture

Status: Active » Needs review

I have added this to the next dev version which will be pushed as soon as the security audit is done.

  • ElusiveMind committed 20711ca on 8.x-1.x
    Issue #2962423 by weseze: Why is it necessary to flush the cache after...
elusivemind’s picture

In 8.x-1.x dev branch now

alison’s picture

Status: Needs review » Fixed

This fix was included in the 8.x-1.0-beta3 release. Thanks all!

alison’s picture

Status: Fixed » Closed (fixed)