Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Add support for roles, selecting active roles and role based access #147

Closed
Michiel-s opened this issue Jan 23, 2023 · 0 comments · Fixed by #175
Closed

Add support for roles, selecting active roles and role based access #147

Michiel-s opened this issue Jan 23, 2023 · 0 comments · Fixed by #175
Assignees

Comments

@Michiel-s
Copy link
Member

Relates to AmpersandTarski/prototype#142

In the old prototype framework, users have the ability to select their active roles as depicted in the screenshot below

image

These roles are defined in the Ampersand ADL script for a specific application. As an example, below the INTERFACE definition for the "Inactive project" interface which includes the statement FOR "Planner". This means that this interface is defined for users with the Planner role.

INTERFACE "Inactive projects" FOR "Planner" : V[SESSION*Project];(-(projectActive) /\ I) BOX <TABLE noHeader noRootTitle>
    [ "Name"            : I
    , "Description"     : projectDescription
    , "Projectleider"   : pl RU
    , "Status"          : projectStatus
    , "Active"          : projectActive RU
    ]

The allowed session roles (i.e. the list of roles a user may select) are provided by the backend when calling the API GET api/v1/app/navbar. Information about (de)activation of certain roles is shared with the backend because this is important give the proper response in other interactions with the backend; not important to elaborate on that here.

image

The state of the session roles is also kept in the sessionStorage of the browser because it is needed e.g. to determine which routes can be activated AmpersandTarski/prototype#142.

image

This feature request to implement this exact behavior in the new frontend, including:

  • Menu item component to toggle (active/deactive) roles
  • Service to share session role state with other components in the application
  • SessionStorage to keep this information and have it available across different tabs in the browsers that have the same application open.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants