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

Permission Constants differ from ACL defaults #21

Open
JDruery opened this issue Apr 16, 2015 · 1 comment
Open

Permission Constants differ from ACL defaults #21

JDruery opened this issue Apr 16, 2015 · 1 comment

Comments

@JDruery
Copy link
Contributor

JDruery commented Apr 16, 2015

I wonder if the permission constants in ParamEntityFinder, LinkedResourcesSerializer, and ResourceObjectSerializer could be changed to all upper case ('VIEW' instead of 'view'). This would make it compatible with the constants defined in BasicPermissionMap in the Symfony ACL system. That way, the ACL system (and the default permission map) could be used in combination with custom voters. In my use case, I'd like a few of the entity classes to be granted permission via the ACL, and others with custom voters. Thanks for considering this.

@JDruery JDruery changed the title Permission Contants don't combine with ACL defaults Permission Constants differ from ACL defaults Apr 16, 2015
@JDruery
Copy link
Contributor Author

JDruery commented Apr 16, 2015

I just realized, doing this would break everyone's voters, if they follow the example template in the symfony docs. For some reason, the examples use lowercase, instead of uppercase like in the ACL system. Perhaps I'm not understanding something here, or maybe no has tried to combine ACL and voters before. I'll likely extend or replace the BasicPermissionMap to make it work (unless someone suggests a better solution).

One solution would be to submit a pull request for symfony security component to make these constants case insensitive (just add strtoupper in the BasicPermissionMap methods that test the permission), but there could be reasons why this is also a bad idea! I tried making this change in my project and it works flawlessly, custom voters combined with acl system.

ben-challis pushed a commit to ben-challis/hateoas that referenced this issue Oct 24, 2016
…resources

[API-51] Relate resources when creating or updating them
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