For the getUser and getUsers endpoints, the User data that's returned should include the Role (associate, supervisor, admin, or none) for each user.
This will require fairly large rework of how we get user data from Cognito, since we don't currently receive the Cognito groups from the Cognito 'ListUsers' response.
Some potential options:
Track roles/groups in a separate Dynamo table, and keep that constantly synced up with the Cognito groups
Instead of using the 'ListUsers' command for Cognito, use the 'ListUsersInGroup' command and gather the users for all three groups
Set up a separate Cognito command that gets the roles for a single or group of users by making a call to 'ListUsersInGroup' and filtering the responses
For the getUser and getUsers endpoints, the User data that's returned should include the Role (associate, supervisor, admin, or none) for each user.
This will require fairly large rework of how we get user data from Cognito, since we don't currently receive the Cognito groups from the Cognito 'ListUsers' response.
Some potential options: