bcgov / BCHeritage_arches

BC Heritage Branch Arches configuration, schemas and extensions.
Apache License 2.0
3 stars 0 forks source link

967 - Conditions added to hide detail sections for internal users #55

Closed jrods closed 2 months ago

jrods commented 2 months ago

bcgov/BCHeritage#967

Also includes a requirement for bcgov/BCHeritage#948 to show the hidden sections on print for internal users.

Implementation notes:

  1. Added an API endpoint to get the currently authenticated (or anonymous user)
  2. Added an isAnonymous function that checks if the username is anonymous
  3. Sections in the details page are hidden if !isAnonymous()
bferguso commented 2 months ago

@jrods - This wasn't working as expected, and the user credentials were being generated at webpack time. I did some poking around and couldn't figure out why that was the case so I built an API endpoint to get the user profile information and used that in the conditional display logic. There is also a KO css binding that can be used to conditionally apply classes so I modified the HTML to use those.