You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current
The User and Client entities have a RoleId reference (as a foreign key) to the Role entity. This is a one-to-one relationship
Solution
Remove the current relationship between the User, Client and Role entities. Create 2 new entities - UserRole and ClientRole. These will store a one-to-many relationship between a UserId / ClientId and RoleId
Task breakdown
When all tasks are completed, then this will reach the definition of done
Create separate UserRole entity that stores UserId and RoleId. Foreign keys from User and Role entities
Create separate ClientRole entity that stores ClientId and RoleId. Foreign keys from Client and Role entities
Populate UserRole and ClientRole entities and PostgreSQL tables
Add functionality to get the many roles stored in the entities
Add those claims in the JWT generation and is returned to the end-user
Feature flag?
Remove RoleId from User entity
Remove RoleId from Client entity
Add / update unit tests
Perform integration tests
The text was updated successfully, but these errors were encountered:
Overview
Add support for multiple roles for a user in the JWT. This will include a database changes - schema, etc.
For example, the
roles
object in the JWT should look like thisUse it as
[Authorize(Roles = "")]
Current
The User and Client entities have a RoleId reference (as a foreign key) to the Role entity. This is a one-to-one relationship
Solution
Remove the current relationship between the User, Client and Role entities. Create 2 new entities - UserRole and ClientRole. These will store a one-to-many relationship between a UserId / ClientId and RoleId
Task breakdown
When all tasks are completed, then this will reach the definition of done
UserRole
entity that storesUserId
andRoleId
. Foreign keys fromUser
andRole
entitiesClientRole
entity that storesClientId
andRoleId
. Foreign keys fromClient
andRole
entitiesUserRole
andClientRole
entities and PostgreSQL tablesRoleId
fromUser
entityRoleId
fromClient
entityThe text was updated successfully, but these errors were encountered: