Skip to main content

API Permissions Reference (ADR-092)

Version: 1.0.0 Base URL: https://api.coditect.ai/api/v1 ADR: ADR-092 Enhanced RBAC Permission System

Overview

This document specifies the required permissions for each API endpoint following the ADR-092 Enhanced RBAC Permission System. All authenticated endpoints enforce permission checks via the PermissionService.

Permission Categories

CategoryDescriptionPermission Codes
usersUser managementlist, view, create, update, delete, invite, remove
tenantsTenant administrationlist, view, create, update, delete, manage, transfer
teamsTeam managementlist, view, create, update, delete, manage
projectsProject managementlist, view, create, update, delete, manage
licensesLicense managementlist, view, create, update, delete, assign, manage
billingBilling operationsview, manage, export
workstationsCloud workstationslist, view, create, update, delete, manage
analyticsAnalytics & reportingview, export, downloads
issuesIssue trackinglist, view, create, update, delete, assign, manage
feedbackFeedback managementlist, view, create, update, delete, assign
adminSystem administrationpanel, provisioning, settings, downloads:approve, audit

Authentication Endpoints

Base Path: /api/v1/auth/

MethodEndpointPermissionDescription
POST/register/None (public)Register new user
POST/login/None (public)Obtain JWT tokens
POST/token/None (public)Obtain JWT token pair
POST/token/refresh/None (public)Refresh access token
POST/token/verify/None (public)Verify token validity
GET/me/AuthenticatedGet current user info

Two-Factor Authentication

Base Path: /api/v1/auth/2fa/

MethodEndpointPermissionDescription
GET/status/AuthenticatedGet 2FA status
POST/setup/AuthenticatedInitialize 2FA setup
GET/qr-code/AuthenticatedGet TOTP QR code
POST/verify/AuthenticatedVerify 2FA setup
POST/disable/AuthenticatedDisable 2FA
GET/backup-codes/AuthenticatedGet backup codes
POST/regenerate-backup-codes/AuthenticatedRegenerate backup codes
POST/verify-code/AuthenticatedVerify single code
POST/send-sms/AuthenticatedSend SMS verification
POST/login-verify/None (token-based)Verify 2FA during login

User Profile

Base Path: /api/v1/profile/

MethodEndpointPermissionDescription
GET/AuthenticatedGet user profile
PATCH/AuthenticatedUpdate user profile

Tenant Management

Base Path: /api/v1/tenants/

MethodEndpointPermissionDescription
GET/AuthenticatedList user's tenant memberships
POST/{tenant_id}/switch/AuthenticatedSwitch active tenant context
GET/{tenant_id}/members/users:listList tenant members
POST/{tenant_id}/members/users:inviteAdd tenant member
GET/{tenant_id}/members/{id}/users:viewGet member details
PATCH/{tenant_id}/members/{id}/users:updateUpdate member role
DELETE/{tenant_id}/members/{id}/users:removeRemove member

Invitations (A.12.1)

MethodEndpointPermissionDescription
GET/{tenant_id}/invites/users:listList pending invitations
POST/{tenant_id}/invites/users:inviteCreate invitation
GET/{tenant_id}/invites/{id}/users:viewGet invitation details
DELETE/{tenant_id}/invites/{id}/users:removeCancel invitation
POST/{tenant_id}/invites/{id}/resend/users:inviteResend invitation email

Public Invitation Accept

MethodEndpointPermissionDescription
GET/invites/{token}/None (token-based)Get invitation details
POST/invites/{token}/accept/None (token-based)Accept invitation

Organization/Tenant API

Base Path: /api/v1/org/

MethodEndpointPermissionDescription
GET/current/AuthenticatedGet current tenant info
GET/{id}/tenants:viewGet tenant details
PATCH/{id}/tenants:updateUpdate tenant settings

Project Management (ADR-092)

Base Path: /api/v1/projects/

Project CRUD

MethodEndpointPermissionDescription
GET/projects:listList accessible projects
POST/projects:createCreate new project
GET/stats/projects:listGet project statistics
POST/bulk-status/projects:manageBulk status update
GET/{id}/projects:viewGet project details
PATCH/{id}/projects:updateUpdate project
DELETE/{id}/projects:deleteDelete project
POST/{id}/archive/projects:manageArchive project
POST/{id}/restore/projects:manageRestore archived project
POST/{id}/transfer/projects:manageTransfer ownership
POST/{id}/pin/projects:updateToggle pin status

Project Members

MethodEndpointPermissionDescription
GET/{id}/members/projects:viewList project members
POST/{id}/members/projects:manageAdd project member
PATCH/{id}/members/{mid}/projects:manageUpdate member role
DELETE/{id}/members/{mid}/projects:manageRemove member

Project Activity

MethodEndpointPermissionDescription
GET/{id}/activity/projects:viewGet activity feed

Project Submodules (ADR-093)

MethodEndpointPermissionDescription
GET/{id}/submodules/projects:viewList submodules
POST/{id}/submodules/projects:manageAdd submodule
GET/{id}/submodules/tree/projects:viewGet submodule tree
POST/{id}/submodules/sync/projects:manageSync all submodules
GET/{id}/submodules/{sid}/projects:viewGet submodule details
PATCH/{id}/submodules/{sid}/projects:manageUpdate submodule
DELETE/{id}/submodules/{sid}/projects:manageRemove submodule
POST/{id}/submodules/{sid}/sync/projects:manageSync specific submodule

Project Hierarchy (ADR-094)

MethodEndpointPermissionDescription
GET/{id}/hierarchy/projects:viewList hierarchy entries
POST/{id}/hierarchy/projects:manageCreate hierarchy entry
GET/{id}/hierarchy/tree/projects:viewGet hierarchy tree
GET/{id}/hierarchy/children/projects:viewGet direct children
GET/{id}/hierarchy/ancestors/projects:viewGet ancestor chain
PATCH/{id}/hierarchy/{hid}/projects:manageUpdate hierarchy entry
DELETE/{id}/hierarchy/{hid}/projects:manageRemove hierarchy entry
GET/hierarchy/roots/projects:listGet root-level projects

Report Management (ADR-095)

Report Templates

Base Path: /api/v1/report-templates/

MethodEndpointPermissionDescription
GET/analytics:viewList report templates
POST/analytics:manageCreate report template
GET/{id}/analytics:viewGet template details
PATCH/{id}/analytics:manageUpdate template
DELETE/{id}/analytics:manageDelete template

Reports

Base Path: /api/v1/reports/

MethodEndpointPermissionDescription
GET/analytics:viewList reports
POST/analytics:createCreate report
GET/{id}/analytics:viewGet report details
PATCH/{id}/analytics:manageUpdate report
DELETE/{id}/analytics:manageDelete report
POST/{id}/run/analytics:viewExecute report
GET/{id}/executions/analytics:viewList executions
GET/{id}/executions/{eid}/analytics:viewGet execution details
GET/{id}/executions/{eid}/download/analytics:exportDownload output

System Administration

Base Path: /api/v1/admin/

MethodEndpointPermissionDescription
GET/stats/analytics:viewPlatform statistics
GET/users/users:listList all users
GET/users/pending-approvals/users:listUsers pending approval
GET/users/{id}/users:viewUser details
PATCH/users/{id}/users:updateUpdate user
POST/users/{id}/approve/admin:downloads:approveApprove downloads
GET/tenants/tenants:listList all tenants
GET/tenants/{id}/tenants:viewTenant details
PATCH/tenants/{id}/tenants:manageUpdate tenant
GET/downloads/analytics/analytics:viewDownload analytics

Permission Management API (ADR-092)

Base Path: /api/v1/permissions/

MethodEndpointPermissionDescription
GET/definitions/admin:panelList all permissions
GET/definitions/{id}/admin:panelGet permission details
GET/role-permissions/admin:panelList role-permission mappings
POST/role-permissions/admin:settingsCreate role-permission mapping
DELETE/role-permissions/{id}/admin:settingsDelete mapping
GET/overrides/admin:panelList user overrides
POST/overrides/admin:settingsCreate user override
DELETE/overrides/{id}/admin:settingsDelete override
GET/audit-logs/admin:auditView audit logs
POST/check/AuthenticatedCheck permission

Context Sync API (ADR-080)

Base Path: /api/v1/context/

MethodEndpointPermissionDescription
GET/sessions/AuthenticatedList sessions
POST/sessions/AuthenticatedCreate session
GET/sessions/{id}/AuthenticatedGet session details
GET/sessions/{id}/summary/AuthenticatedGet session summary
GET/activity/AuthenticatedGet activity feed
GET/decisions/AuthenticatedList project decisions
POST/decisions/AuthenticatedCreate decision
GET/preferences/AuthenticatedGet user preferences
PUT/preferences/AuthenticatedUpdate preferences

Workstations API (ADR-005)

Base Path: /api/v1/workstations/

MethodEndpointPermissionDescription
GET/workstations:listList workstations
POST/workstations:createCreate workstation
GET/{id}/workstations:viewGet workstation details
PATCH/{id}/workstations:updateUpdate workstation
DELETE/{id}/workstations:deleteDelete workstation
POST/{id}/start/workstations:manageStart workstation
POST/{id}/stop/workstations:manageStop workstation

License API

Base Path: /api/v1/licenses/

MethodEndpointPermissionDescription
GET/licenses:listList licenses
POST/licenses:createCreate license
GET/{id}/licenses:viewGet license details
PATCH/{id}/licenses:updateUpdate license
DELETE/{id}/licenses:deleteDelete license
POST/{id}/assign/licenses:assignAssign to user
POST/acquire/AuthenticatedAcquire floating seat
POST/release/AuthenticatedRelease floating seat
POST/heartbeat/AuthenticatedSession heartbeat

Billing API (A.12.2)

Base Path: /api/v1/billing/

MethodEndpointPermissionDescription
GET/invoices/billing:viewList invoices
GET/invoices/{id}/billing:viewGet invoice details
GET/invoices/{id}/download/billing:exportDownload PDF
GET/subscription/billing:viewGet subscription info
PATCH/subscription/billing:manageUpdate subscription
POST/subscription/cancel/billing:manageCancel subscription

Issues API (ADR-021)

Base Path: /api/v1/issues/

MethodEndpointPermissionDescription
GET/issues:listList issues
POST/issues:createCreate issue
GET/{id}/issues:viewGet issue details
PATCH/{id}/issues:updateUpdate issue
DELETE/{id}/issues:deleteDelete issue
POST/{id}/assign/issues:assignAssign issue
POST/{id}/comments/issues:viewAdd comment

Feedback API

Base Path: /api/v1/feedback/

MethodEndpointPermissionDescription
GET/feedback:listList feedback
POST/feedback:createSubmit feedback
GET/{id}/feedback:viewGet feedback details
PATCH/{id}/feedback:updateUpdate feedback
DELETE/{id}/feedback:deleteDelete feedback

Releases API (C.8)

Base Path: /api/v1/releases/

MethodEndpointPermissionDescription
GET/None (public)List releases
GET/latest/{binary}/None (public)Get latest release
GET/{id}/None (public)Get release details
POST/signed-urlAuthenticated + ApprovedGet signed download URL

Commerce API (ADR-014)

Base Path: /api/v1/commerce/

MethodEndpointPermissionDescription
GET/products/None (public)List products
GET/products/{slug}/None (public)Get product details
GET/cart/AuthenticatedGet cart
POST/cart/AuthenticatedAdd to cart
DELETE/cart/{id}/AuthenticatedRemove from cart
POST/checkout/AuthenticatedCreate checkout session
GET/orders/AuthenticatedList orders
GET/orders/{id}/AuthenticatedGet order details
GET/entitlements/AuthenticatedGet entitlements

Platform API (ADR-080)

Base Path: /api/v1/platform/

MethodEndpointPermissionDescription
GET/components/None (public)List components
GET/components/{id}/None (public)Get component details
GET/agents/None (public)List agents
GET/skills/None (public)List skills
GET/commands/None (public)List commands

Role Permission Matrix

System Roles

RoleDescriptionKey Permissions
super_adminFull platform accessAll permissions
supportCustomer supportusers:, issues:, feedback:*, analytics:view
salesSales teamtenants:view, licenses:manage, billing:*
readonlyRead-only access*:view, *:list only
userStandard userprojects:view, issues:create, feedback:create

Tenant Roles

RoleDescriptionKey Permissions
ownerTenant ownerAll tenant-scoped permissions
adminTenant administratorusers:, teams:, projects:*, licenses:assign
memberTeam memberprojects:create, issues:create, feedback:create
viewerRead-only member*:view, *:list only
guestExternal collaboratorprojects:list, projects:view

Team Roles

RoleDescriptionKey Permissions
leadTeam leadprojects:manage, issues:assign
memberTeam memberprojects:update, issues:update
viewerRead-only access*:view only

Error Responses

401 Unauthorized

{
"detail": "Authentication credentials were not provided."
}

403 Forbidden

{
"error": "Permission denied: projects:delete",
"detail": "You do not have the projects:delete permission."
}

Permission Check Implementation

All endpoints use PermissionService for RBAC checks:

from permissions.services import PermissionService

permission_service = PermissionService()
if not permission_service.check_permission(request.user, 'projects:delete'):
return Response(
{'error': 'Permission denied: projects:delete'},
status=status.HTTP_403_FORBIDDEN
)

References


Last Updated: 2026-01-21 Author: CODITECT Team