You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
The securityAfterResolver GraphQL operation attribute was introduced in #6444 to allow adding a security to check to run after the resolver. However, it does not seem to ever run the expression - meaning developers can think they are securing their API, but it silently not working.
MyCustomResolver can just return $item. The securityAfterResolver expression is never called when running the operation.
Possible Solution
I think this may be due to a missing break in AccessCheckerProvider. This means that immediately after the securityAfterResolver expression is assigned to the $isGranted variable, it is immediately overwritten by the default case, where it sets $isGranted to the security expression. However, as there is a comment it looks like the missing break was intentional - but I don't see how it could work without it.
The text was updated successfully, but these errors were encountered:
API Platform version(s) affected: 3.3.8+
Description
The
securityAfterResolver
GraphQL operation attribute was introduced in #6444 to allow adding a security to check to run after the resolver. However, it does not seem to ever run the expression - meaning developers can think they are securing their API, but it silently not working.How to reproduce
Example resource
MyCustomResolver
can just return$item
. ThesecurityAfterResolver
expression is never called when running the operation.Possible Solution
I think this may be due to a missing break in AccessCheckerProvider. This means that immediately after the
securityAfterResolver
expression is assigned to the$isGranted
variable, it is immediately overwritten by the default case, where it sets$isGranted
to thesecurity
expression. However, as there is a comment it looks like the missing break was intentional - but I don't see how it could work without it.The text was updated successfully, but these errors were encountered: