Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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
@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.

3 participants