JMSSecurityExtraBundle icon indicating copy to clipboard operation
JMSSecurityExtraBundle copied to clipboard

How to check if expression function exists?

Open ioleo opened this issue 10 years ago • 0 comments

also asked on stackoverflow

I want to validate a configuration file. One of the fields is "credentials" which should accept valid JMS/SecurityExtraBundle expression, eg. isLocalUser() or canPublishNews(object) or hasRole('ROLE_API') or even hasRole('ROLE_A') or hasRole('ROLE_B') (see docs).

So.. given a string... how can I validate it's a valid JMS/SecurityExtraBundle expression without actually running the expression?

At the moment of config validation I don't have any security context (nor object context), only the credentials string, so running the expression is impossible.

ioleo avatar Mar 21 '14 23:03 ioleo