Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security.yaml access_control is not correct #1553

Open
gundesli opened this issue Jan 5, 2025 · 0 comments
Open

Security.yaml access_control is not correct #1553

gundesli opened this issue Jan 5, 2025 · 0 comments

Comments

@gundesli
Copy link

gundesli commented Jan 5, 2025

In security.yaml the access_control part is useless and content an error :

    access_control:
        # this is a catch-all for the admin area
        # additional security lives in the controllers
        - { path: '^/{_locale}/admin', roles: ROLE_ADMIN }

this line not working because {_locale} is not a regular expression (which can be misleading) :

    - { path: '^/{_locale}/admin', roles: ROLE_ADMIN }

The security of controller Admin\BlogController is managed by the attribute IsGranted :

#[Route('/admin/post')]
#[IsGranted(User::ROLE_ADMIN)]
final class BlogController extends AbstractController
{
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant