-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Navigation AbstractHelper::accept should not call isAllowed unless Acl is set #202
Comments
Which can be modified via:
It would be great if you could create a pull request for this. |
@froschdesign I would have already opened a pull request for it I just can not see a way to test the effect of this particular change to accept(). |
Signed-off-by: Joey Smith <[email protected]> Signed-off-by: Joey Smith <[email protected]>
I closed the pull request but I am leaving this because it still needs addressed at some point. |
@tyrsson |
Gotcha. I have often wondered why those two components do not share a common interface... In lieu of this discussion I would say that the documentation for the getUseAcl() method needs to be changed in the online manual. https://docs.laminas.dev/laminas-navigation/helpers/intro/
|
I created two reports to track the documentation issues: |
Bug Report
Summary
Upon installing Laminas Navigation and using the menu helper due to the check in AbstractHelper::accept being made to $this->getUseAcl() (which as far as I can tell is always true) you get a call to isAllowed for every menu entry that is currently visible even when there has not been an Acl instance set.
Current behavior
The helper calls isAllowed with no need to call isAllowed(). If there has not been an instance set then the page can not be filtered by the call to isAllowed since in this condition isAllowed should return true. A user should not have to notify the helper to not use an Acl explicitly if an instance has not been set. At least I wouldn't think that would be the desired behavior.
How to reproduce
Simply install Laminas Navigation, create a container and use the menu helper to render it without setting an Acl instance.
Expected behavior
Without setting an instance of the Acl or without delegating one for the helper to use, which in turn sets an instance, I would expect that isAllowed would not be called at all. I would also think that the check would use $this->hasAcl().
The line of code in question is AbstractHelper line #325
The text was updated successfully, but these errors were encountered: