Skip to content

Permissions & Roles

CutX uses a hierarchical role system with granular permissions and full audit logging for all admin actions.

RoleLevelDescription
user0Standard user — can manage own resources
admin1Platform admin — can manage users, jobs, credits
owner2Platform owner — full access including billing and settings

Higher roles inherit all permissions from lower roles. An owner can do everything an admin can do, plus owner-only actions.

PermissionDescription
admin.accessAccess the admin dashboard
admin.statsView platform-wide statistics
admin.users.viewView all user accounts
admin.users.grant_creditsAdd bonus credits to any user
admin.users.set_roleChange user roles (within hierarchy)
admin.users.suspendSuspend or unsuspend users
admin.jobs.viewView all generation jobs
admin.jobs.refundRefund credits for any job
admin.jobs.retryRetry failed/expired jobs
admin.jobs.cancelCancel active jobs
PermissionDescription
admin.settingsModify platform settings
admin.billingAccess billing and revenue data
admin.rolesManage role definitions
admin.dangerousDestructive operations (data purge, etc.)
  • Users can only assign roles below their own level
  • Admins can set users to user or admin
  • Only owners can promote someone to admin
  • No one can self-promote
  • Admins can suspend users with role user
  • Owners can suspend users with role user or admin
  • No one can suspend an owner
  • Suspended users cannot log in or make API calls

The requirePermission() middleware validates permissions before processing requests:

GET /api/admin/users
Authorization: Bearer <token>

If the user lacks admin.users.view, they receive:

{
"error": "Forbidden",
"message": "Missing permission: admin.users.view"
}
StatusDescription
activeNormal account, full access
suspendedTemporarily blocked, can be reinstated
bannedPermanently blocked

Every admin action is recorded in admin_audit_log:

{
"id": "uuid",
"admin_id": "uuid",
"action": "user.grant_credits",
"target_type": "user",
"target_id": "uuid",
"details": {
"amount": 100,
"reason": "Support compensation"
},
"ip_address": "203.0.113.42",
"created_at": "2026-03-09T..."
}
ActionDescription
user.grant_creditsAdmin added credits to a user
user.set_roleAdmin changed a user’s role
user.suspendAdmin suspended a user
user.unsuspendAdmin reinstated a user
job.refundAdmin refunded credits for a job
job.retryAdmin retried a failed job
job.cancelAdmin canceled an active job

Audit logs are append-only — they cannot be modified or deleted through the application. Each entry includes the admin’s user ID and IP address for accountability.