Skip to content

Symfony 6 IsGranted at the controller level regression #51361

Closed as not planned
Closed as not planned
@justmoen

Description

@justmoen

Description

The following annotation applied at the top of the controller granted access to all controller actions, prior to the deprecation of @Security.

/**
 * @Security("is_granted('view', 'PermissionModuleName'))
 */
class SomeController {}

To allow the following, equivalent functionality,

#[IsGranted('view', 'PermissionModuleName')]
class SomeController {}

change IsGrantedAttributeListener->getIsGrantedSubject() method to

return $arguments[$subjectRef] ?? $subjectRef

Example

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions