Skip to content

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

@emudojo

Description

@emudojo

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>
 */

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions