Problem/Motivation
When a user's role changes, the grants are not updated until permissions are rebuilt. This has security implications, as administrators may not understand that permissions need to rebuilt after a role has been given or taken away.
Steps to reproduce
- Create a role called "access own article" that has the "View own article content" permission.
- Remove the "View * article content" permission for anonymous user and authenticated user.
- Create a user ("bob") who has the "access own article" role.
- Log-in as bob.
- As the new user, create an article node named "Article".
- Remove the "access own article" role from bob.
- As bob, attempt to view the "Article" node.
- Rebuild node access permissions.
- As bob, attempt to view the "Article" node.
- Grant bob the "access own projects" role.
- As bob, attempt to view the "Article" node.
- Rebuild node access permissions.
- As bob, attempt to view the "Article" node.
Expected result:
#5: "Article" accessible.
#7: "Article" not accessible.
#9: "Article" not accessible.
#11 "Article" accessible.
#13 "Article" accessible.
Actual result:
#5: "Article" accessible.
#7: "Article" accessible.
#9: "Article" not accessible.
#11: "Article" not accessible.
#13 "Article" accessible.
Proposed resolution
This bug was also in the branch for Drupal 7, see #2474309: "content_access_author" grant does not react to role changes. There is a patch to be ported.
Comments
Comment #3
gisleThis has been committed to the latest snapshot of 2.0.x-dev.
Comment #5
steven jones commentedAh, we never added a test for this change, I think we should have used that lovely test case in the issue summary to do that.
I'll make a new issue to do so.