-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 informations are ignored in role security #4925
Comments
Faced the same problem. The solution helped me:
config.yml
|
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This issue is pretty old, is it still relevant ? Do you have a repository to reproduce the issue ? I have a config similar to the one proposed by @Xmblr and it works fine for me. |
Yes, the issue is still relevant. The solution provide by @Xmblr describes a different problem. I updated the issue description to provide more information about the actual problem. |
I've never used ACL, I'm kinda interested to debug this in order to learn more but I have a lot of question. Seems like ACL are not recommended anymore #7303 Also can you describe how you do ?
This seems not hard to debug: |
Can you explain how to reproduce the issue @core23 ? I never used ACL before. Also, does it means ACL are not working at all so far for SonataAdmin ? |
This is not related to the ACL itself, but the ACL security handlers works a little different than the normal role handler.
I thought the issue description is clear enough, but I can try to explain it a little bit more. Normally you have the following rules: CREATE, DELETE, EDIT, EXPORT, LIST and VIEW on an admin. Given the following config, I would expect if you assign the EDITOR role for a specific admin (e.g. AcmeAdmin.php) to a user, the user would be able to receive the EDIT, LIST and CREATE roles for this admin.
This works if you use the |
Looking at the code, we have
then
And if you look at all the call of
So this seems pretty clear that the feature is ACL-related so I'm not chocked if it's only for But we might be able to add this to the role security ; currently we're doing
We could add something like
WDYT @core23 ? |
Looking at the
there is no check to Are you sure it works this way for AclHandler ? Does giving the |
To me it looks like over complicating a feature that is already flexible enough. If the security information is only used for ACL, imho it should stay the same |
To me the feature is just doing something different than what is asked here, even for the AclHandler. So this is more a new feature with a new configuration key which could be something like But this issue/feature request was pending for 3 years without any activity so I think we can close it. |
Environment
Sonata packages
Symfony packages
PHP version
Subject
When using the role security model and defining an information mapping, the mapping is ignored.
Steps to reproduce
Define the following config:
Add a the
ACME_VIEWER
permission to a user or group for the ACME admin.Expected results
The user gets the
ROLE_SONATA_ACME_ADMIN_ACME_VIEWER
role and can access the corresponding admin page.Actual results
The user gets the
ROLE_SONATA_ACME_ADMIN_ACME_VIEWER
role, but can't access the admin page, because the role is not translated to the sub roles:ROLE_SONATA_ACME_ADMIN_ACME_VIEW
,ROLE_SONATA_ACME_ADMIN_ACME_LIST
andROLE_SONATA_ACME_ADMIN_ACME_EXPORT
.Probable soltution.
The
securityInformation
is only used for ACL permissions inside theAclSecurityHandler
class. There is no special handling inside theRoleSecurityHandler
class.The text was updated successfully, but these errors were encountered: