POST /api/roles//permissions/
Assigns an existing permission to a role. Once assigned, all users with this role will gain the associated permission.Authentication
This endpoint requires authentication. Include a valid JWT token in the Authorization header.Path Parameters
The unique identifier of the role to which the permission will be assigned
The unique identifier of the permission to assign to the role
Response
This endpoint returns204 No Content on success with an empty response body.
Error Responses
- 404 Not Found: Role or permission with the specified ID does not exist
- 409 Conflict: The permission is already assigned to this role
- 500 Internal Server Error: Unexpected server error
Example Request
Example Success Response
Example Error Response (Not Found)
Example Error Response (Conflict)
Usage Notes
- Both the role and permission must exist before assignment
- Attempting to assign the same permission twice will result in a 409 Conflict error
- Users with this role will immediately gain access to the new permission
- This action is logged in the audit trail with action type
ASIGNAR_PERMISO - Verify permission requirements before assignment to avoid over-privileging