ZF-8501: Add Zend_Application_Resource_Acl


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} = "G"

# Assigning parents to a role
# resources.acl.roles.{roleName}.parents = {parentRoleIds} (multiple in csv) = "U" 
resources.acl.roles.user.parents = "G"

# Adding a resource
# resources.acl.resources.{resourceName}.id = {resourceId} = "I" = "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.



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.