PHPackages                             jcpires/cakephp3-aclmanager - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. jcpires/cakephp3-aclmanager

ActiveCakephp-plugin[Utility &amp; Helpers](/categories/utility)

jcpires/cakephp3-aclmanager
===========================

An acl-manager plugin for CakePhp3

65.8k↓100%9PHP

Since Mar 16Pushed 9y ago1 watchersCompare

[ Source](https://github.com/JcPires/CakePhp3-AclManager)[ Packagist](https://packagist.org/packages/jcpires/cakephp3-aclmanager)[ RSS](/packages/jcpires-cakephp3-aclmanager/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

CakePhp3-AclManager
===================

[](#cakephp3-aclmanager)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.txt)[![CakePHP 3](https://camo.githubusercontent.com/582c124400cc765a3645988baf8c3396a1041ce09f6f5f4344459fe6a9ea7467/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f56657273696f6e2d43616b65506870253230332d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](http://cakephp.org)[![Build Status](https://camo.githubusercontent.com/b095617881d2c1ead2b4e6bbac9e25ade902ff64d2c6d4ba5d539fda494f1176/68747470733a2f2f7472617669732d63692e6f72672f4a6350697265732f43616b65506870332d41636c4d616e616765722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/JcPires/CakePhp3-AclManager)

Install
-------

[](#install)

```
    Composer require jcpires/cakephp3-aclmanager

```

or on composer.json

```
    "jcpires/cakephp3-aclmanager": "dev-master"

```

### Requirements

[](#requirements)

[CakePhp ACL](https://github.com/cakephp/acl)

How to
------

[](#how-to)

### Build your Acos

[](#build-your-acos)

First you need to build your acos, to do, you need to add this lines where you want. There are two way:

- By an event:

    ```
        use JcPires\AclManager\Event\PermissionsEditor;

    ```

    ```
        $this->eventManager()->on(new PermissionsEditor());
        $acosBuilder = new Event('Permissions.buildAcos', $this);
        $this->eventManager()->dispatch($acosBuilder);

    ```
- By the component

    ```
        $this->loadComponent('JcPires/AclManager.AclManager');
        $this->AclManager->acosBuilder();

    ```

NB: !!! Don't forget to delete those lines after building !!!

### Add permissions when creating a new group

[](#add-permissions-when-creating-a-new-group)

!!! Be caution, to works, you need first a first level ARO with base node full granted like a Super Admin like this on the aros\_acos table: create:1 read: 1 update: 1 delete: 1!!!

On your Admin/GroupsController.php

```
    use JcPires\AclManager\Event\PermissionsEditor;

```

Add basics permissions, on your action add

```
    if ($this->Groups->save($group)) {

        if (isset($this->request->data['parent_id'])) {
            $parent = $this->request->data['parent_id'];
        } else {
            $parent = null;
        }

        $this->eventManager()->on(new PermissionsEditor());
        $perms = new Event('Permissions.addAro', $this, [
            'Aro' => $group,
            'Parent' => $parent,
            'Model' => 'Groups'
        ]);
        $this->eventManager()->dispatch($perms);
    }

```

### Edit permissions

[](#edit-permissions)

1. On your action edit()

```
we need to get all acos "not really necessary is just an automatic array builder":

```
    $this->loadComponent('JcPires/AclManager.AclManager');
    $EditablePerms = $this->AclManager->getFormActions();
```

If you to exclude some actions for the form like ajax actions, you have to add a static property

On the specified controller like PostController or BlogController, ...:

```
    public static $AclActionsExclude = [
        'action1',
        'action2',
        '...'
    ];
```

You will have an array with all acos's alias indexed by the controller aco path like:

```
    'Blog' => [
        'add',
        'edit',
        'delete
    ],
    'Post' => [
        'add',
        'edit',
        'delete'
    ],
    'Admin/Post' => [
        'add',
        'edit',
        'delete'
    ]
```

```

2. Build your form

```
First if you want to use the AclManager Helper

```
    public $helpers = [
            'AclManager' => [
                        'className' => 'JcPires/AclManager.AclManager'
                    ]
        ];

    // on your action in your controllerPath
    $EditablePerms = $this->AclManager->getFormActions();
```

an exemple with an Acl helper for checking if permissions are allowed or denied:

```

```

render:

```

        No
        Yes

```

```

If you don't use the Array Builder you need to specified your input name like aco path: App/Blog/add or App/Admin/Blog/add ... :base/:folder/:subfolder/:controller/:action "Folder and subfolder can be empty"

3. Update new permissions

```
```

    if ($this->request->is('post')) {

        $this->eventManager()->on(new PermissionsEditor());
        $perms = new Event('Permissions.editPerms', $this, [
            'Aro' => $group,
            'datas' => $this->request->data
        ]);
        $this->eventManager()->dispatch($perms);
    }

```

data need to be like this 'aco path' => value "0 deny / 1 allow"

```
    'App/Blog/add' => 0
    'App/Blog/edit' => 1
    ...
```

```

###  Health Score

28

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e95da5038fc102a0e4f97b4032a014bb063db6faa5e25cf142b596b5e8c452a9?d=identicon)[JcPires](/maintainers/JcPires)

---

Top Contributors

[![JcPires](https://avatars.githubusercontent.com/u/15987808?v=4)](https://github.com/JcPires "JcPires (4 commits)")[![aipacommander](https://avatars.githubusercontent.com/u/6161879?v=4)](https://github.com/aipacommander "aipacommander (1 commits)")

### Embed Badge

![Health badge](/badges/jcpires-cakephp3-aclmanager/health.svg)

```
[![Health](https://phpackages.com/badges/jcpires-cakephp3-aclmanager/health.svg)](https://phpackages.com/packages/jcpires-cakephp3-aclmanager)
```

###  Alternatives

[samrap/acf-fluent

A fluent interface for the Advanced Custom Fields WordPress plugin

28555.3k4](/packages/samrap-acf-fluent)

PHPackages © 2026

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