RBAC & Authorization
Access control endpoints for roles, permissions, role grants, and user role assignments.
RBAC & Authorization
ForkFit supports robust, granular Role-Based Access Control (RBAC). Admin roles are seeded automatically at startup. All RBAC endpoints are nested under /api/v1/auth.
1. Role Management
List Roles
GET /api/v1/auth/roles
Returns all configured security roles.
Create Custom Role
POST /api/v1/auth/roles
Creates a new access role.
- Payload Parameters:
Prop
Type
2. Permission Management
List Permissions
GET /api/v1/auth/permissions
Returns all configured security permission keys.
Create Custom Permission
POST /api/v1/auth/permissions
Registers a new permission code.
- Payload Parameters:
Prop
Type
3. RBAC Mapping & Assignments
Map Permission to Role
POST /api/v1/auth/roles/{role_id}/permissions/{permission_id}
Assigns a permission code to a specified role.
Remove Permission from Role
DELETE /api/v1/auth/roles/{role_id}/permissions/{permission_id}
Revokes a permission mapping from a role.
Assign Role to User
POST /api/v1/auth/users/{user_id}/roles/{role_id}
Grants an access role to a specific user.
Remove Role from User
DELETE /api/v1/auth/users/{user_id}/roles/{role_id}
Revokes an assigned access role from a user.