Skip to content

[LIMS-1698] Hide industrial visits from users/staff not included as part of visit#3

Merged
gfrn merged 18 commits intomasterfrom
feature/lims-1698/hide-industrial-visits
May 15, 2025
Merged

[LIMS-1698] Hide industrial visits from users/staff not included as part of visit#3
gfrn merged 18 commits intomasterfrom
feature/lims-1698/hide-industrial-visits

Conversation

@gfrn
Copy link
Collaborator

@gfrn gfrn commented Apr 24, 2025

JIRA ticket: LIMS-1698

Note: I've merged feature/lims-1707/heatmap into this branch by accident, it will include changes from both branches

Summary:

To prevent unwanted data access, this pull request adds the option to limit access to visits/proposals to those who are directly listed as part of that visit/proposal, and no one else (including staff).

Changes:

  • Add option to restrict proposal/visit visibility to members of that proposal/visit (users_only_on_industrial)
  • Return empty array for tomograms with no motion data/proposals with no sessions

To test:

  • Send a GET request to resources which belong to industrial proposals (such as movies, bFactorFit, CTF, etc.) (/autoProc/99498883/ctf) and ensure 404 is returned
  • Send a GET request to /proposals?search=in, check if no industry proposals are returned (prefixed by ic, il, sw or in)
  • Send a GET request to /sessions?proposal=in1, check if no sessions are returned
  • Add yourself to that proposal and visit, repeat, check if 200 is returned

@gfrn gfrn requested review from MattPrit, RichB-DLS and ndg63276 April 24, 2025 15:32
@gfrn gfrn self-assigned this Apr 24, 2025
@codecov
Copy link

codecov bot commented Apr 25, 2025

Codecov Report

Attention: Patch coverage is 96.29630% with 2 lines in your changes missing coverage. Please review.

Project coverage is 94.45%. Comparing base (f0b75bc) to head (eef22dd).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
src/pato/auth/micro.py 75.00% 1 Missing ⚠️
src/pato/utils/auth.py 93.75% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master       #3      +/-   ##
==========================================
+ Coverage   94.39%   94.45%   +0.05%     
==========================================
  Files          42       43       +1     
  Lines        1783     1784       +1     
==========================================
+ Hits         1683     1685       +2     
+ Misses        100       99       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

gfrn added 2 commits May 15, 2025 13:10
…:DiamondLightSource/pato-backend into feature/lims-1698/hide-industrial-visits
Copy link
Collaborator

@MattPrit MattPrit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gfrn gfrn merged commit 3ff0443 into master May 15, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants