Basically move some of the code in group_entity_access() over to the access control handlers. Will attach a POC patch but it will still need tests to be adjusted for the code move and tests to prove that you can swap these out to achieve different results.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | group-3163506-11.patch | 27.26 KB | kristiaanvandeneynde |
| #9 | group-3163506-9.patch | 13.9 KB | kristiaanvandeneynde |
| #9 | interdiff-5-9.txt | 758 bytes | kristiaanvandeneynde |
Comments
Comment #2
kristiaanvandeneyndePOC, might go very red.
Comment #3
kristiaanvandeneyndeAlso this makes plugins operate in isolation, so if there's two that define access and one says Forbidden whereas the other says Allowed, this would now return Forbidden. In the old code we would loop over all plugins and then return a result based on what all plugins had to say together instead of in isolation. So in that case, it would find that one of the plugins allows access and return that instead of Forbidden.
Edge case scenario, but still important to consider.
Comment #5
kristiaanvandeneyndeStraight up reroll that also fixes the unit tests. But new unit tests should be added too.
Comment #7
avo webworks commentedThank you,
With this patch in place, users are now able to access their account again, and content that they have access for with Content Access Module.
Patch works well.
Comment #8
kristiaanvandeneyndeIt's a proof-of-concept with failing tests. I'd really advise against using this in production yet :)
Comment #9
kristiaanvandeneyndeThis silly mistake made tests go red. Should be all green now, but I'd still like unit tests for the new method.
Comment #10
avo webworks commentedWith patch 5 users where able to access their account after they have logged in. Patch 9 they are not and get access denied.
Drupal behaviour that after you login you are taken to the /user page where you see your account.
Why is that being blocked with access denied by the group module now? Am I missing something in settings?
Comment #11
kristiaanvandeneyndeThis completes the patch from #9 by adding 4096 unit test cases and optimizing/fixing some code.
Comment #12
kristiaanvandeneyndeRe @avostar in #10: The patch from #5 was buggy and incomplete. I told you not to rely on it :) Also this patch should not change user profile access at all unless you have a plugin that adds users to a group with entity_access set to TRUE (GroupMembership does not do this).
Comment #14
kristiaanvandeneyndeCommitting so I can at least try and keep the promise of people being able to revert to a more compatible way.