-
Notifications
You must be signed in to change notification settings - Fork 3
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
Next/Prev entities should point to only entities in the queryset that the user is allowed to see #1415
Comments
do you know if that works if you use your custom manager solution? |
I haven't quite managed to select different custom managers for different user access tiers (fiddling around middleware to get the user data). |
We are already using the |
Yes, I can confirm that if I setup the list access like so in the model then Prev/Next links will only take the user to the entities that are accessible to the user This is the PR in Tibschol that implements it - https://github.com/acdh-oeaw/apis-instance-tibschol/pull/196/commits The approach works well also with the other (nastier) custom managers I have for Instance and Work models. |
Continuing #1412
Consider the following ID sequence
1000, 1001*, 1002, 1003*, 1004 where entities marked with * are not accessible to the user.
Expected behaviour from page 1002:
Prev
takes the user to 1000Next
takes the user to 1004Current behaviour:
Prev
takes the user to login page with a redirect to 1001Next
takes the user to login page with a redirect to 1003I believe for a smooth experience, just like the listview that hides entities that the user doesn't have permissions to see, the next/prev links in the detail page should only link to the next/prev entities in the listview queryset that the user is allowed to see.
The text was updated successfully, but these errors were encountered: