ZF-8501: Add Zend_Application_Resource_Acl
Description
For simple ACL implementations, this would allow the user to configure the ACL in the application.ini. Granted this could be easily done in the Bootstrap.php in an _initAcl() method, but I prefer to keep most of my configuration in my application.ini.
Here's a sample application.ini for setting up the ACL.
# Adding a role
# resources.acl.roles.{roleName}.id = {roleId}
resources.acl.roles.guest.id = "G"
# Assigning parents to a role
# resources.acl.roles.{roleName}.parents = {parentRoleIds} (multiple in csv)
resources.acl.roles.user.id = "U"
resources.acl.roles.user.parents = "G"
# Adding a resource
# resources.acl.resources.{resourceName}.id = {resourceId}
resources.acl.resources.index.id = "I"
resources.acl.resources.error.id = "E"
# Add a role with a parent
# resources.acl.resources.{resourceName}.parent = {parentResourceId}
# Adding rules to resources
# resources.acl.resources.{resourceName}.{ruleType}.{privilege}.roles = {roleIds} (multiple in csv)
resources.acl.resources.index.allow.all.roles = "all"
resources.acl.resources.error.allow.all.roles = "all"
resources.acl.resources.users.allow.all.roles = "U"
resources.acl.resources.users.deny.edit.roles = "G"
resources.acl.resources.users.deny.delete.roles = "G"
# When resourceName, privilege and/or roleIds is "all", it will be substituted with null when adding rules
# resources.acl.resources.all.allow.all.roles = "all"
I've attached the resource to this issue.
Comments
Posted by Joe Gornick (jgornick) on 2009-12-08T16:44:51.000+0000
My_Application_Resource_Acl
Posted by Dolf Schimmel (Freeaqingme) (freak) on 2010-07-16T14:09:52.000+0000
After further discussion it has been decided this will have to go through the proposal process.
Please note that there's already such a proposal, and it is suggested proposers proposing the same collaborate. Having said this, chances are Zend_Acl will be removed with Zend Framework 2.0, and therefore a resource plugin like this may not be that necessary.