Please implement an API that allows users to explore and manage roles in a self-service manner. The API should support the following operations:
-
Find all roles owned by a user
- Returns all roles where the given user is the owner.
-
Find all roles where a user is a member
- Returns all roles the user is assigned to via
role_assignees.
- Returns all roles the user is assigned to via
-
Search roles
- Supports search by:
idnamedisplay_name
- Include optional filters to narrow results (for example
search only by display name).
- Supports search by:
-
Fetch role details by ID
- Returns role information including:
idnamedisplay_namedescriptionowner- Assigned users
- Entitlements
- Returns role information including:
-
Change role data
- Update the role details:
- Display name
- Descrpition
- Owner
- Only Role Owner can edit this data.
- Update the role details:
- Implement a simple UI to perform the operations supported by API. Pages needed:
Roles I haveRoles I ownSearch rolesRole detais
- Authentication is not required; hardcode a "current user" for demonstration purposes.
- The backend should use an H2 database with preloaded dummy data.
- SQL file:
/backend/src/main/resources/data.sql
- Use Spring for the REST API.
- Use Angular for frontend.