Skip to content

Extend configuration to allow defining parents for resources #4

@eremem

Description

@eremem

Feature Request

Q A
New Feature yes
RFC no
BC Break no

Summary

While porting an application based on Zend Framework 1 to Mezzio, I noticed that there seems to be no way to define a parent resource ID for the elements of ['mezzio-authorization-acl']['resources'].

It looks like a 'technical debt' in \Mezzio\Authorization\Acl\LaminasAclFactory::injectResources(), since \Laminas\Permissions\Acl\Acl::addResource($resource, $parent = null) allows passing a parent as its 2nd argument.

Comparing to the RBAC, it was IMHO a vital feature and an argument for using the ACL implementation in the first place. On the other hand, it makes the meaning of the 'deny' node in the configuration somewhat questionable - why denying access to any resource if you can just omit it in the 'allow' section?
Since there is effectively no way of configuring the grouping (or inheritance) of resources, we just get a plain list of allowed ones, which actually makes the whole ACL implementation logically similar (if not equal) to the RBAC... but with an overcomplicated configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions