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

PIMS-2081 Frontend Authorization Changes #2685

Merged
merged 20 commits into from
Sep 18, 2024

Conversation

dbarkowsky
Copy link
Collaborator

@dbarkowsky dbarkowsky commented Sep 18, 2024

🎯 Summary

PIMS-2081

To bring the frontend in-line with the changes in PIMS-2082.

Changes

  • Add hasOneOfRoles function to pimsUser in AuthContext.
  • Swap out all instances of keycloak.hasRoles or keycloak.client_roles with pimsUser.hasOneOfRoles

Testing

  • Change your role id in the database and use the frontend to see if options restricted to admins, etc. are visible/hidden.
    • Examples: edit buttons, admin button in header, don't see the Awaiting Role page

🔰 Checklist

  • I have read and agree with the following checklist and am following the guidelines in our Code of Conduct document.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation where required.
  • I have tested my changes to the best of my ability.
  • My changes generate no new warnings.

@dbarkowsky dbarkowsky self-assigned this Sep 18, 2024
@dbarkowsky dbarkowsky marked this pull request as ready for review September 18, 2024 17:21
Base automatically changed from PIMS-2082 to main September 18, 2024 18:28
Copy link
Collaborator

@LawrenceLau2020 LawrenceLau2020 left a comment

Choose a reason for hiding this comment

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

Looking good, appropriate menu items are showing on the correct roles and edit buttons are hidden when they should be.

@github-actions github-actions bot added the React label Sep 18, 2024
@dbarkowsky dbarkowsky merged commit 4c89950 into main Sep 18, 2024
8 checks passed
@dbarkowsky dbarkowsky deleted the PIMS-2081-Frontend-Auth-Changes branch September 18, 2024 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants