Download the PHP package edweld/aclbundle without Composer
On this page you can find all versions of the php package edweld/aclbundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package aclbundle
Installation
I needed to create an ACL which I could use on a site wide search on a high traffic web app. I have a complex data structure where users have a many to many relationship with groups (or product specific defined as circles) and circles can have one to many events. Users can only create or view events and users that belong a circle, circles are created dynamically so I needed something a little more advanced than symfony-acl as I needed to filter domain level entities on a sql query level. Most of the credit goes to Matthieu Napoli for the inital concept, my intention is to share and evolve it with the Symfony community as it really is such an excellent concept. It's only available @dev currently.
Feel free to fork/contribute.
Code is on github: https://github.com/edweld/symfony-alternative-acl
An example implmentation can also be found https://github.com/edweld/symfony-acl-with-query-helper-example
-
Add to composer
-
Register the bundle in app/AppKernel.php
-
Add Doctrine mappings in your config
- Map your security identity entity to the Acl Doctrine Security interface, the security entity is the user entity you use in authentication, in my case AppBundle\Entity\User.php This enables the bundle to use an interface to define the security.
We then map our security interface to our user security identity
- Add the following to you security configuration
Using the service container
Use the service container in a service, command or controller.
Available actions are currently
- VIEW
- CREATE
- EDIT
- DELETE
- UNDELETE
- ALLOW
Create Role Entities
Create An Read only Doctrine Entity for each Role for object level permissions, this means we can cascade actions, for each permission setting, if you have multiple permissions consider creating a Base class and extending specific permissions.
Create as many different permission group Entities as you want.
Link domain enities to Roles for cascading deletion
Configure roles entities in application config
Grant and revoke access using service container
And then use the QueryHelper to add permissions to queries
For my final implementation I wrapped everything up in a service within my application
All versions of aclbundle with dependencies
symfony/framework-bundle Version >=3.0
symfony/options-resolver Version ~2.6|~3.0
symfony/property-access Version ~2.6|~3.0
friendsofsymfony/jsrouting-bundle Version ~1.6|~2.0
symfony/security-acl Version ~3.0