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

Relations with restricted documents visible #1033

Open
kpsherva opened this issue Feb 12, 2021 · 0 comments
Open

Relations with restricted documents visible #1033

kpsherva opened this issue Feb 12, 2021 · 0 comments
Labels

Comments

@kpsherva
Copy link
Contributor

kpsherva commented Feb 12, 2021

Package version (if known): v1.0.0a27

Describe the bug

The relation between documents, one restricted, one not restricted is still visible on the frontsite, while the point of having the restricted document was to hide it from the patrons.

Expected behavior

We should filter out the restricted documents to be visible in the relation fields

Possible implementation

Currently, the restricted field is only taken into account when searching for documents, and not in relations.

  1. Change relations_metadata to add the restricted field along with the doc title, etc..., at least when True
  2. Change the document serializer to remove the on-the-fly the relation to the restricted document if the user is not authorized
  3. Change the search filter in the backend to exclude the search in relations_metadata.document when relations_metadata.document.restricted: True and the user is not authorized
@kpsherva kpsherva added bug Something isn't working major and removed bug Something isn't working labels Feb 12, 2021
@kpsherva kpsherva added L and removed major labels Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant