Using frankenphp, AccessDecisionManager is still caching isGranted decisions after adding new ROLE to my users
#62247
Replies: 3 comments · 3 replies
-
|
The AccessDecisionManager does not cache decisions. It only caches the Regarding whether the API platform AccessCheckerProvider could be the cause, I have no idea. This should be reported to the API Platform team. |
Beta Was this translation helpful? Give feedback.
-
|
I think I have another issue which seems to be related. I use Expression language I need to restart frankenphp, to see my expression changes taken into account. The common point here is Expression language: API platform uses it for |
Beta Was this translation helpful? Give feedback.
-
|
I might have found the root issue: lexik/LexikJWTAuthenticationBundle#1307 Initial issue was occuring on the same user (username) on API endpoint using JWT. So if |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Environment: Symfony 7.3.5 (env: prod, debug: false), ApiPlatform v4.2.2
Runtime: FrankenPHP
I think AccessDecisionManager service is not stateless and may create issues when using a runtime like FrankenPHP or Swoole.
If I create a new User wihtout the right ROLE, I try to access a protected route with
isGranted. Access is denied.Then I add the required role to this User, I try again: access is still denied. Because voter decisions have been cached inside
AccessDecisionManagerservice.The only solution is to restart FrankenPHP worker.
Is there any solution to "clear" AccessDecisionManager caches when updating any User roles?
I see 3 locations where caching may occur:
is_grantedSymfony ExpressionFunctionAccessDecisionManager only cache supported Voter for an attribute or an object, but does not cache decision itself.
Beta Was this translation helpful? Give feedback.
All reactions