Skip to content

Conversation

@MatteoGuarnaccia5
Copy link
Contributor

@MatteoGuarnaccia5 MatteoGuarnaccia5 commented Nov 12, 2025

Description

Based off original issue #1472, admin functionality is added via parseToken.ts , which will return if the current user's token has any role that is also a part of the configured privilegedRoles . If the user does have a privileged status, they will be able to edit/create units/usage statuses (completed in this PR), bypass rules (to be done #1523 ), and an alert with their role will appear in the top right of the website.

The /admin route, along with component and filenames have been renamed to be /settings , Settings etc

Please note:
This PR is dependent on ral-facilities/ldap-jwt-auth#271 in ldap-jwt-auth, and should be merged in conjunction with it, to avoid breaking changes.

This PR adds a new key/value pair to the inventory-management-system-settings.json , this change should also be made in scigateway for production.

Testing instructions

  • Review code
  • Check Actions build
  • Review changes to test coverage

Agile board tracking

connect to #1472

@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

❌ Patch coverage is 99.26740% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.82%. Comparing base (678342f) to head (31f1ab9).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/parseTokens.ts 75.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1596      +/-   ##
===========================================
- Coverage    98.82%   98.82%   -0.01%     
===========================================
  Files          111      114       +3     
  Lines        21769    21920     +151     
  Branches      2501     2512      +11     
===========================================
+ Hits         21514    21663     +149     
- Misses         254      256       +2     
  Partials         1        1              

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

joelvdavies
joelvdavies previously approved these changes Nov 13, 2025
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.

4 participants