Remove role setup
DELETE/groups-srv/roles/:role
This API call deletes role setup with given role (name) if it is not assigned to a user group and it is not assigned to any user.
Validation Rules:
- The role must exist in the system.
- The role must not be assigned to any user group (via groupType allowedRoles configuration).
- The role must not be assigned to any user (via userGroupMap).
- Roles with
roleOwner: admincannot be deleted.
Business Rules:
- Before deleting a role, ensure it is removed from all groupType configurations.
- Before deleting a role, ensure it is removed from all user group maps.
- System roles (roleOwner: admin) are protected and cannot be deleted.
Request
Responses
- 200
- 401
- 404
- 417
OK - Role deleted successfully
UNAUTHORIZED - Authentication failed or missing required scope
RESOURCE NOT FOUND - Role Setup does not exist
Expectation Failed - Role is still in use (assigned to groups or users) and cannot be deleted