I'm experimenting with ZF2's ACL implementation (Zend\Permissions\Acl\Acl) and can't help but think of how much unnecessary overhead there is in dynamically creating my ACL rules with each page load. I'm not using this in a ZF2 application, just a procedural page, so no BjyAuthorize or the sort.
Is there a way to export the ACL rules so I can essentially just run a script which re-creates the ACL only when certain actions occur (IE: when a new user is created or permissions/associations are changed)? There is an old old post which mentions this method for ZF1, so I was wondering if there is similar ability in ZF2.
So I was thinking about this in the wrong way. Instead of comparing the user to the entire ACL list, I needed to compare the resource the user is requesting to the user's specific ACL list. This way I don't have to load every user and resource in the system on every page load, only the ones which apply (IE: the current user).