Feature Request
| Q |
A |
| New Feature |
yes |
| RFC |
yes |
| BC Break |
no |
Summary
As of now the laminas-permissions-acl gets created within the LaminasAcl factory (https://github.com/mezzio/mezzio-authorization-acl/blob/master/src/LaminasAclFactory.php#L46).
Besides the usage within the authorization-middleware (https://github.com/mezzio/mezzio-authorization/blob/master/src/AuthorizationMiddleware.php) via the isGranted() method I would like to be able to use it, in my case, inside a view helper to show/hide navigation items according to the route and currently logged-in user.
Problem is, I cannot access the isAllowed() of the Acl from outside the LaminasAcl. Neither can I extend the LaminasAcl to use the acl property as it is private.
I would need to hydrate the Acl another time by myself to be able to use it.
Some solutions I have in mind (either/or):
- add an isAllowed() proxy method to the LaminasAcl
- add a getAcl() to the LaminasAcl
- move the new Acl() + resource/roles/rule hydration into its' own service/factory to request it via $container->get(Acl::class)
I'm happy to prepare a pull-request according to whatever the outcome is.
What do you think?
Feature Request
Summary
As of now the laminas-permissions-acl gets created within the LaminasAcl factory (https://github.com/mezzio/mezzio-authorization-acl/blob/master/src/LaminasAclFactory.php#L46).
Besides the usage within the authorization-middleware (https://github.com/mezzio/mezzio-authorization/blob/master/src/AuthorizationMiddleware.php) via the isGranted() method I would like to be able to use it, in my case, inside a view helper to show/hide navigation items according to the route and currently logged-in user.
Problem is, I cannot access the isAllowed() of the Acl from outside the LaminasAcl. Neither can I extend the LaminasAcl to use the acl property as it is private.
I would need to hydrate the Acl another time by myself to be able to use it.
Some solutions I have in mind (either/or):
I'm happy to prepare a pull-request according to whatever the outcome is.
What do you think?