JMSSecurityExtraBundle icon indicating copy to clipboard operation
JMSSecurityExtraBundle copied to clipboard

[Feature request] Allow to define expression checks as string

Open stof opened this issue 12 years ago • 2 comments

Some bundles (FOSCommentBundle for instance) allow to configure the roles they check for different actions they are doing. But disabling the core voters make it impossible to use their implementation as we cannot vote on a string anymore but we have to pass an Expression object (which cannot be built in a YAML file).

Would it be possible to allow the expression voter to access strings too, with a convention to detect it should be considered as an expression ? It could check for strings starting with Expression: for instance

stof avatar Jan 31 '13 10:01 stof

I thought about this when I made expressions compatible with the core access_control section, but I think it would be better if these bundles provide a separate key where you can define the expression like access vs roles for example.

schmittjoh avatar Jan 31 '13 10:01 schmittjoh

But it would mean that all bundles providing soem sort of security check has to explicitly add the support of expressions. If they were in the core, I would say it is fine. But they are provided by a third party bundle so IMO, the bundle should make it easier to integrate with others.

stof avatar Jan 31 '13 10:01 stof