Roles & Permissions API
Role-based access control with system roles and custom role support. Forgexa has roles at two levels: organization and workspace.
Organization Roles
| Role | Description |
|---|---|
owner | Full control including ownership transfer and deletion. One per org. |
admin | Manage members, invitations, integrations, budgets, audit logs, templates. |
member | View org data, access workspaces, create workspaces. |
Organization admins automatically have admin-level access to all workspaces within the organization.
Workspace Roles (System)
| Role | Description |
|---|---|
owner | Full control including ownership transfer |
admin | Workspace/project management, member management |
developer | Create/execute work items, review gates, manually force-complete verification |
viewer | Read-only access |
Permission Matrix
Get the full permission matrix for all system roles.
GET /api/v1/permissions/matrix
Authorization: Bearer <token>Response 200 OK
{
"permissions": [
"project:read",
"project:create",
"requirement:read",
"execution:execute",
"gate:review",
"deployment:trigger"
],
"descriptions": {
"project:read": "View projects and their settings",
"execution:execute": "Start new execution pipelines",
"gate:review": "Submit gate reviews (approve/reject)"
},
"roles": {
"viewer": ["project:read", "requirement:read", "execution:read"],
"developer": ["project:read", "requirement:create", "execution:execute", "gate:review"],
"admin": ["project:create", "project:update", "deployment:trigger"],
"owner": ["project:delete", "workspace:settings"]
}
}Verification Force Completion
POST /api/v1/verification/workflows/{workflow_id}/force-complete requires qa:force_complete. System roles developer, admin, and owner receive this permission; viewer does not. Existing custom roles with gate:override remain authorized for backward compatibility. qa:execute alone does not grant this bypass.
Authorization uses the effective project role and custom permissions. Project membership is still required for non-administrators, and a project-level viewer override does not inherit the workspace developer's force-completion permission. Custom QA roles can be granted qa:force_complete without granting the broader gate:override permission.
The status API exposes the caller-specific can_force_complete capability, which the web and Desktop clients use to show the action. Both clients retain a warning and explicit confirmation: this operation skips final automated QA and the verification quality gate, then starts delivery; it does not mean the QA results passed. A verification.force_completed audit entry records the actor, project, workflow, verification graph, and previous workflow/verification states in the same transaction. Normal completion, other gate overrides, and project access rules are unchanged. Existing workflows are not advanced automatically.
Custom Roles
List Roles
Returns both system roles and workspace-scoped custom roles.
GET /api/v1/workspaces/{workspace_id}/roles
Authorization: Bearer <token>Create Custom Role
Requires admin role.
POST /api/v1/workspaces/{workspace_id}/roles
Authorization: Bearer <token>
Content-Type: application/json
{
"name": "QA Lead",
"description": "Can review gates and manage QA suites",
"permissions": [
"project:read",
"requirement:read",
"execution:read",
"gate:read",
"gate:review",
"qa:read",
"qa:execute",
"qa:manage"
]
}Update Custom Role
PUT /api/v1/workspaces/{workspace_id}/roles/{role_id}
Authorization: Bearer <token>System roles cannot be modified.
Delete Custom Role
DELETE /api/v1/workspaces/{workspace_id}/roles/{role_id}
Authorization: Bearer <token>System roles cannot be deleted.