Closed olamstevy closed 2 weeks ago
the endpoint is wrong, as you have two different functionalities, one to manage roles and another to assign roles to users. this is ambigious
@olamstevy This is still two endpoints in one Ticket. Please break into two and go into more detail.
See #235
also add the Schema so we see what you are working with before second approval
Please share second ticket with someone else or create it and share with me
Description
Develop an API endpoint that allows only superadmins or admins including organisation owner to assign roles to other active users in an organisation. Users can only have a role such as admin, guest, or member.
Purpose
The endpoint provides superadmins, including organistion owners with the right to assign roles to users in an organisation.
Acceptance Criteria
/api/v1/organisations/{org_id}/users/{user_id}/roles
.role
,user_id
andorg_id
fields must be validated.Requirements
Database Schema
Endpoints
Requests
Assign a role to a user in an organisation Method:
POST
Endpoint URL:/api/v1/organisations/{org_id}/users/{user_id}/roles
Authorization Header:"Authorization": "Bearer abc123ABC123abd...."
Request Body:Response
Successful Response when a user has been assigned a role.
Failed Validation Response
Failed Authorization Response
Testing
Documentation
The endpoint should be documented containing use cases with accurate response and error messages
Expected Outcome