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

Wrong calculation for isPublic field values #329

Closed
2 tasks
VKTB opened this issue Feb 14, 2022 · 0 comments · Fixed by #330
Closed
2 tasks

Wrong calculation for isPublic field values #329

VKTB opened this issue Feb 14, 2022 · 0 comments · Fixed by #330
Assignees
Labels
bug Something isn't working expands-search-api Issues relating to the ExPaNDS Search API section of this repo

Comments

@VKTB
Copy link
Contributor

VKTB commented Feb 14, 2022

Description:
Sending the following request:
http://{{datagateway-api}}/search-api/documents?filter={"where": {"isPublic": false}, "limit": 5}

returns documents whose isPublic field value is set to False.

At the moment, we set the Document's isPublic field value based on the Investigation's releaseDate ICAT field so if it was released more than 3 years ago then it is set to True. This is wrong because releaseDate is the date it was released publicly so the check should instead be releaseDate <= today. We do the same for the Dataset's isPublic field value but instead use the Dataset's createTime ICAT field which is not the correct field to be used. Instead we need to use the parent Investigation's releaseDate field to determine if it is public or not.

Considering that the Search API uses the anon user when querying ICAT, it means that all the data returned from ICAT is public so if there are any issues with getting the above working then we can just hardcode so that it always return True for the isPublic fields and ignore the filter on those fields.

Acceptance criteria:

  • All returned Dataset records have isPublic set to True.
  • All returned Document records have isPublic set to True.
@VKTB VKTB added bug Something isn't working expands-search-api Issues relating to the ExPaNDS Search API section of this repo labels Feb 14, 2022
@VKTB VKTB self-assigned this Feb 14, 2022
VKTB added a commit that referenced this issue Feb 14, 2022
VKTB added a commit that referenced this issue Feb 14, 2022
VKTB added a commit that referenced this issue Feb 14, 2022
VKTB added a commit that referenced this issue Feb 14, 2022
VKTB added a commit that referenced this issue Feb 14, 2022
VKTB added a commit that referenced this issue Feb 14, 2022
@VKTB VKTB closed this as completed in #330 Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working expands-search-api Issues relating to the ExPaNDS Search API section of this repo
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant