I noticed a (static?) caching issue in \Drupal\group\Access\ChainGroupPermissionCalculator(). After I retrieved a user's permissions with `\Drupal\group\Access\ChainGroupPermissionCalculator::calculatePermissions()` then it did not matter which user I passed to the method, it always returned the same result.

On the attached screenshot you can see that first I tried to retrieve all permissions of User 4, then User 1, but I got the same result, although it should have been different. Even the "user:4" cache tag is the same on the returned result.
Installed version: 8.x-1.x-dev b41ee99bb.
Comments
Comment #2
mxr576Comment #3
mxr576Additional context: User 1 is not a member of any existing groups.
Comment #4
mxr576Hm... could it be just easy like this? For the first sight, it seems only an account-specific cache key was missing from the cache key for logged in users.
Comment #5
mxr576Added test coverage.
Comment #6
kristiaanvandeneyndeDoes this still happen with the latest dev? I just pushed a change to how we calculate permissions for a passed in account.
Comment #7
kristiaanvandeneyndeYour test-only patch goes green locally. Will commit your extra test coverage if it goes green here :)
Comment #8
kristiaanvandeneyndeActually, this should now be properly covered by the tests that use a non-current-user to calculate permissions with. Closing as a duplicate of the issue that spotted this first. Will add you to the credits there.
Comment #9
mxr576Thanks! So if I am not mistaken, ^ this issue contained the fix for this problem as well.