Closed strazdinsg closed 3 years ago
@ANicholasson @MrPrecise Comments on role naming and logic?
I think it's good to prefix with ORG as it is mentioned.
For the logic part: Will need to add the roles to the general-api registered keycloak client. Will then have to get the IDs of the roles in keycloak or some value we can use to get the RoleRepresentation (probably the role name is enough actually). And add them to the database somehow. The logic for authorizing a organization user would be as followed.
So will probably need a many-to-many relation between user and OrgRole (some table) and between user and org. Not sure how the database architecture should look like.
After looking at the entity structure I see that there can be a much simpler system for organization membership management: many-to-many relationship between Organization and User, where the relationship also includes a role as a string. Will try to implement that and simplify the entities during the process.
Instead of having simple ADMIN and MEMBER roles, we need to extend the roles for organizations.
Suggested naming of roles:
This issue would involve implementing the roles in the AuthorizationService. Implementation of necessary role check in the backend and frontend will be separate issues.