ACL implementation in cake php 4

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

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?

I got this done on my own…