schmittjoh / JMSSecurityExtraBundle

Enhances the Symfony2 Security Component with several new features
http://jmsyst.com/bundles/JMSSecurityExtraBundle
255 stars 100 forks source link

@RunAs misinterpreted as an actual annotation when it shoud not #223

Open emudojo opened 6 years ago

emudojo commented 6 years ago

I was getting this error after updating to master today

[Semantical Error] The annotation "@RunAs" in class JMS\SecurityExtraBundle \Security\Authorization\Voter\IddqdVoter was never imported. Did you maybe forget to add a "use" statement for this annotation?

found this

/**
 * This voter adds a special role "ROLE_IDDQD" which effectively bypasses any,
 * and all security checks.
 *
 * Most of the time, you will want to use this rule in combination with a
 * @RunAs annotation to disable security checks for the invocation of a
 * specific method.
 *
 * @author Johannes M. Schmitt <schmittjoh@gmail.com>
 */

as @RunAs is being used at the very beginning the parser is trying to interpret it and fails, surrounding it with quotes fixes the error

/**
 * This voter adds a special role "ROLE_IDDQD" which effectively bypasses any,
 * and all security checks.
 *
 * Most of the time, you will want to use this rule in combination with a
 * "@RunAs" annotation to disable security checks for the invocation of a
 * specific method.
 *
 * @author Johannes M. Schmitt <schmittjoh@gmail.com>
 */