PHPackages                             data-dog/acl-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. data-dog/acl-bundle

ActiveBundle[Authentication &amp; Authorization](/categories/authentication)

data-dog/acl-bundle
===================

ACL management bundle

0.1.5(11y ago)3333MITPHPPHP &gt;=5.4.0

Since Jan 28Pushed 11y ago2 watchersCompare

[ Source](https://github.com/DATA-DOG/acl-bundle)[ Packagist](https://packagist.org/packages/data-dog/acl-bundle)[ Docs](https://github.com/DATA-DOG/acl-bundle)[ RSS](/packages/data-dog-acl-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (7)Used By (0)

ACL management bundle [![Build Status](https://camo.githubusercontent.com/c2f5daef95d0c898a8efa6c5055cada1fb072498029a2a9b67f90928ac5cbc37/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f444154412d444f472f61636c2d62756e646c652e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/DATA-DOG/acl-bundle)
===========================================================================================================================================================================================================================================================================================================================

[](#acl-management-bundle-)

ACL comes without any database requirements. It is bare **ACL** manager. The bundle only registers **resource** and **access policy** providers. See **DOCTRINE.md** which shows how to configure database for policy management.

- Has symfony profiler bar
- Does not depend on database
- Basic resource and policy concept

Configuration
-------------

[](#configuration)

This is the default **ACL** bundle configuration:

```
acl:
  default_allowed: false # means that by default all ACL resources are denied
  resource:
    providers:
      config: true       # by default looks in bundles for ACL resources
      annotations: true  # looks for controller annotations
    transformers:
      doctrine: true     # transforms entities or document resources with an ID at the end
```

ACL resource
------------

[](#acl-resource)

A resource is basically represented by a string.

```
$acl->isGranted("action", "app.resource.string");
```

Would be **"app.resource.string.action"**. Action is concatenated. That way it is easier to store and match resources.

- **app.resource.string** - is a resource acccess point.
- **action** - is any action that can be done with the resource.

ACL resource providers
----------------------

[](#acl-resource-providers)

Providers are used to collect all ACL resources from bundles. The ACL provider interface:

```
namespace AclBundle\Resource;

interface ProviderInterface
{
    /**
     * Get a list of available ACL resources
     *
     * @return array - ['resource.string.action', ...]
     */
    function resources();
}
```

All provider services must be tagged with **acl.resource.provider**. They should build a resource map as required by interface.

### Bundle configuration

[](#bundle-configuration)

This type of ACL resource provider is enabled by default. It looks for configuration file: **../VendorBundle/Resources/config/acl\_resources.yml** and loads all resources from each bundle.

```
resources:
  - app_bundle.entity.page.view
  - app_bundle.entity.page.edit
```

ACL policy providers
--------------------

[](#acl-policy-providers)

ACL policy providers must implement **AclBundle\\Access\\PolicyProviderInterface** and implement one method which return a list of policies, where key is a resource or resource branch and value is boolean - whether the resource is granted or denied.

Given we have these resources:

```
resources:
  - app.user.edit
  - app.user.view
  - app.user.remove
  - app.user.add
```

We can make policies for leaf actions:

```
acl:
  access:
    policies:
      luke@skywalker.com:
        - { resource: app.user.edit, granted: true }
        - { resource: app.user.view, granted: true }
        - { resource: app.user.add,  granted: true }
```

Or we can do the same thing by granting access to the branch and denying leaf:

```
acl:
  access:
    policies:
      luke@skywalker.com:
        - { resource: app.user,        granted: true }
        - { resource: app.user.remove, granted: false }
```

**NOTE:** The configuration above is the **ACL** bundle extension configuration. Which should be located in kernel configuration directory.

### Config provider

[](#config-provider)

For very simple use cases, config provider may be used. To enable it, acl configuration must contain some accesses in the map:

```
acl:
  access:
    policies:
      admin:
        - { resource: app_bundle, allow: true }          # allow every action for all resources under app_bundle
      someusername:
        - { resource: some.resource, allow: true }       # allow all actions on some.resource
        - { resource: some.resource.edit, allow: false } # but deny - some.resource.edit
        - { another.resource.somewhere.create }          # default allowed
```

It will load this access map based on username of currently logged user from security context. Though the user model must implement **Symfony\\Component\\Security\\Core\\User\\UserInterface**

### ACL resource transformers

[](#acl-resource-transformers)

Sometimes it may be useful to transform an object to a specific resource with identifier for deep permission checks. As an example we could have **form type** resources identified by name:

```
use AclBundle\Util;
use AclBundle\Resource\TransformerInterface;
use Symfony\Component\Form\FormTypeInterface;

class FormTransformer implements TransformerInterface
{
    public function supports($object)
    {
        return $object instanceof FormTypeInterface;
    }

    public function transform($object)
    {
        return 'form.' . Util::underscore($object->getName());
    }
}
```

This transformer service then may be registered with tag: **acl.resource.transformer**, it accepts a priority attribute. When **acl** actions may be checked like:

```
$container->get('acl.access.decision_manager')->isGranted('edit', $formTypeObject);
```

**NOTE:** these resources must be provided, either through configuration or by resource provider service.

For convenience, make a service alias:

```
# app/config/config.yml or other
services:
  acl: @acl.access.decision_manager
```

Questions and Answers
---------------------

[](#questions-and-answers)

**Q:** Why it does not have a vendor namespace. **A:** Hopefully, you need only one AclBundle in your projects, cheers.

Tests
-----

[](#tests)

Tested with phpunit. To run all tests:

```
composer install
bin/phpunit

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

6

Last Release

4096d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b007520624bae09a9b2c11dc14b6c0f176b8d08456f84dcf3111a3a262ed29a?d=identicon)[l3pp4rd](/maintainers/l3pp4rd)

---

Top Contributors

[![l3pp4rd](https://avatars.githubusercontent.com/u/132389?v=4)](https://github.com/l3pp4rd "l3pp4rd (20 commits)")

---

Tags

symfonybundlesecurityaclpermissionaccess control lists

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/data-dog-acl-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/data-dog-acl-bundle/health.svg)](https://phpackages.com/packages/data-dog-acl-bundle)
```

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[hosseinhezami/laravel-permission-manager

Advanced permission manager for Laravel.

403.3k](/packages/hosseinhezami-laravel-permission-manager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
