# ACL implementation in cake php 4

**URL:** <https://discourse.cakephp.org/t/acl-implementation-in-cake-php-4/8989>\
**Category:** Need Help\
**Tags:** help\
**Created:** [February 9, 2021, 2:26pm UTC](https://discourse.cakephp.org/t/acl-implementation-in-cake-php-4/8989 "2021-02-09T14:26:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rsuyambu](https://avatars.discourse-cdn.com/v4/letter/r/a3d4f5/32.png) [@rsuyambu](https://discourse.cakephp.org/u/rsuyambu)\
**Post date:** [February 9, 2021, 2:26pm UTC](https://discourse.cakephp.org/t/acl-implementation-in-cake-php-4/8989/1 "2021-02-09T14:26:24Z")

</div>

Trying to use ACL in cakephp 4,

Getting the following error.  
Exception: AclNode::node() - Couldn’t find Aros node identified by "Array  
(  
[Aros0.model] =\> Roles  
[Aros0.foreign\_key] =\> 1  
)  
"  
In [/var/www/html/WEBANDAPP/hyperisland/vendor/cakephp/acl/src/Model/Table/AclNodesTable.php, line 188]

2021-02-09 15:25:24 Error: [Cake\Core\Exception\Exception] AclNode::node() - Couldn’t find Aros node identified by "Array  
(  
[Aros0.model] =\> Roles  
[Aros0.foreign\_key] =\> 1  
)  
" in /var/www/html/WEBANDAPP/hyperisland/vendor/cakephp/acl/src/Model/Table/AclNodesTable.php on line 188  
Stack Trace:

- /var/www/html/WEBANDAPP/hyperisland/vendor/cakephp/acl/src/Model/Table/PermissionsTable.php:227
- /var/www/html/WEBANDAPP/hyperisland/vendor/cakephp/acl/src/Model/Table/PermissionsTable.php:169
- /var/www/html/WEBANDAPP/hyperisland/vendor/cakephp/acl/src/Adapter/DbAcl.php:97
- /var/www/html/WEBANDAPP/hyperisland/vendor/cakephp/acl/src/Controller/Component/AclComponent.php:136
- /var/www/html/WEBANDAPP/hyperisland/vendor/cakephp/acl/src/Shell/AclShell.php:265
- /var/www/html/WEBANDAPP/hyperisland/vendor/cakephp/cakephp/src/Console/Shell.php:501
- /var/www/html/WEBANDAPP/hyperisland/vendor/cakephp/cakephp/src/Console/CommandRunner.php:353
- /var/www/html/WEBANDAPP/hyperisland/vendor/cakephp/cakephp/src/Console/CommandRunner.php:168
- /var/www/html/WEBANDAPP/hyperisland/bin/cake.php:12

---

<div class="post-metadata">

**Author:** ![serjio](https://avatars.discourse-cdn.com/v4/letter/s/a87d85/32.png) [@serjio](https://discourse.cakephp.org/u/serjio)\
**Post date:** [March 20, 2021, 12:00am UTC](https://discourse.cakephp.org/t/acl-implementation-in-cake-php-4/8989/2 "2021-03-20T00:00:59Z")

</div>

I need to implement authorization inside of my app. I’ve used most of the popular libraries in the past (clearance, cancan/can, pundit, etc) but for this app I have a few use cases that rule those out IMO.

The authorization first needs to be role based, then user based. Users inherit permissions from their role and then can receive individual permissions granted/denied. The permissions also need to be able to be manipulated by the end user.

The original application is written in CakePHP with authorization using their ACL library. Should I try writing my own MPTT ACL gem or is there a simpler route that I’m just not seeing?

---

<div class="post-metadata">

**Author:** ![serjio](https://avatars.discourse-cdn.com/v4/letter/s/a87d85/32.png) [@serjio](https://discourse.cakephp.org/u/serjio)\
**Post date:** [March 21, 2021, 9:26am UTC](https://discourse.cakephp.org/t/acl-implementation-in-cake-php-4/8989/3 "2021-03-21T09:26:21Z")

</div>

> [@serjio](#):
>
> I need to implement authorization inside of my app. I’ve used most of the popular libraries in the past (clearance, cancan/can, pundit, etc) but for this app I have a few use cases that rule those out IMO.
> 
> The authorization first needs to be role based, then user based. Users inherit permissions from their role and then can receive individual permissions granted/denied. The permissions also need to be able to be manipulated by the end user.  
> [https://100001.onl/](https://100001.onl/) [https://1921681254.mx/](https://1921681254.mx/)  
> The original application is written in CakePHP with authorization using their ACL library. Should I try writing my own MPTT ACL gem or is there a simpler route that I’m just not seeing?

I got this done on my own…
