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

Enable security information mapping for RoleSecurityHandler #8192

Merged
merged 2 commits into from
Jul 15, 2024

Conversation

core23
Copy link
Member

@core23 core23 commented Jul 5, 2024

Subject

I am targeting this branch, because this feature is BC.

Finally provide #4925 feature

Changelog

### Added
-  Enable security information mapping for `RoleSecurityHandler`

If you want to combine multiple permissions, you can now use the sonata.admin.security.handler.role for this.

sonata_admin:
    security:
        handler:    sonata.admin.security.handler.role

        information:
            VIEWER:    [VIEW, LIST, EXPORT]
            EDITOR:    [EDIT, LIST, CREATE]
            ADMIN:     [OPERATOR, MASTER]

If you have a user with a ROLE_ACME_ADMIN_VIEWER permission, the security handler will work if your admin asks for VIEW, LIST or EXPORTER grants.

The changes are BC, because if will also work if you have no special information mapping.

@core23 core23 force-pushed the role-information-mapping branch 2 times, most recently from 3cd9930 to c57d8ba Compare July 5, 2024 13:07
src/Security/Handler/RoleSecurityHandler.php Outdated Show resolved Hide resolved
src/Security/Handler/RoleSecurityHandler.php Outdated Show resolved Hide resolved
@core23
Copy link
Member Author

core23 commented Jul 15, 2024

@VincentLanglet VincentLanglet merged commit 77db467 into sonata-project:4.x Jul 15, 2024
24 of 25 checks passed
@core23 core23 deleted the role-information-mapping branch July 15, 2024 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants