-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Inconsistencies in /libraries/legacy/view/category.php #7825
Comments
The category is loaded using
which is running already an access check:
as you see it is an option which can be set. It defaults to So you would have to disable the access check in the model.if you want to do the check it in the view. Adding that line |
did what you suggest (I think) but to no effect. $category is still null |
in https://github.com/joomla/joomla-cms/blob/staging/components/com_content/models/category.php#L356-L357 should work. At least it did for me when testing with com_content. |
Indeed, this works, but as I tested further, I discovered another bug (with or without this code) Note: with the new code, there are indeed consequences: displaying public parent category will also display link to registered category. (In the case above it redirected to home page) |
Isn't that quite a stupid setup to begin with? If the home menu item isn't supposed to show public articles/categories, what should it show to guests then? Just an error message? |
Ok, take it like this then: The question is simply: should the items contained in a category —to which one has no access— be displayed or not on a joomla site? |
=> It seems it is controlled by the "Show Unauthorised Links" parameter of the menu item (in Options tab). If you set it to No (I think it is default behavior), these articles won't be showed. |
closing because we have a PR #11624 |
While making the PR #7824, I found that I could not solve the issue when a category is concerned.
Test:
Create a menu item displaying a category. Set its access to Public.
Set the category access to Registered.
When displaying the menu item in frontend (not logged in) one will get an error page with
404 Category not found
We should instead get a
You are not authorised to view this resource.
I traced this to:
https://github.com/joomla/joomla-cms/blob/staging/libraries/legacy/view/category.php#L120-L136
Basically, it looks like a category is considered false when access is not authorised.
The text was updated successfully, but these errors were encountered: