Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make acl accessable from outside LaminasAcl #3

Open
kiwijuicer opened this issue Feb 16, 2020 · 0 comments
Open

Make acl accessable from outside LaminasAcl #3

kiwijuicer opened this issue Feb 16, 2020 · 0 comments

Comments

@kiwijuicer
Copy link

kiwijuicer commented Feb 16, 2020

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant