Problem/Motivation

"Reset to defaults" button for custom node settings triggers submit function pageResetSubmit()
where $grants are retrieved using

    $grants = $this->entityTypeManager->getAccessControlHandler('node')->acquireGrants($node);

But this will get current node grants, and trigger no update of `node_access` table. So original access settings is still considered, which is wrong.
Corresponding lines in table will be deleted when running cache rebuild (e.g. drush php-eval 'node_access_rebuild();'), but there is no message warning about it.

Steps to reproduce

Proposed resolution

IMHO will be much better to call this content_access_get_type_grant() function to get default content_type grants settings which will be then applied

    $grants = content_access_get_type_grant($node);

This solution seems to be working well.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

Bohus Ulrych created an issue. See original summary.

gisle’s picture

Version: 8.x-1.x-dev » 2.0.x-dev

All bug fixes go into the most recent branch.

osopolar’s picture

"Reset to defaults" and submitting the defaults again sets the right grants. Could it be related to caches?