ivanamat / cakephp3-aclmanager

CakePHP 3.x - Acl Manager
MIT License
27 stars 27 forks source link

Permissions.ctp Template View Logic around $allowed vs $mallowed #21

Closed joakim-emagine closed 6 years ago

joakim-emagine commented 6 years ago

I was wondering why you doing an Acl->check(), rather than just use the permissions already set in the $perms variable? It really starts to slow down the page for larger systems.

https://github.com/ivanamat/cakephp3-aclmanager/blob/2f38ea81bac10247383879e5f588d4897c2ee00c/src/Template/Acl/permissions.ctp#L115

ivanamat commented 6 years ago

Hi @joakim-emagine

The difference of $acl->check() and $ perms is that $acl->check() checks the permissions of the logged in user, $perms is the array of permissions to generate the form of all the AROS, if you consider $perms instead of doing $acl->check(), the problem is that even the ARO with the most privileges can not see those permissions in order to edit them.

I want to put this optionally shortly as there are more people who have told me that they are using the plugin in large projects and have the same problem.

Regards!