Skip to content

Role-Permission Matrix

Last Updated: 2026-04-03 Source of truth: Route middleware configuration in routes/api.php, routes/admin.php, routes/billing.php

Authentication Guards

GuardModelToken PrefixUsage
sanctum (web)Uservalidonx_SPA tenant users — onboarding, billing portal, account
adminAdminvalidonx_Admin panel — tenant management, billing admin, audit
API KeyApiKeyVXS- / VXP- / VXE-Integration API — license validation, activations

Route Groups & Middleware

Public (no auth)

RouteMiddlewarePurpose
GET /api/v1/plansList available plans
POST /api/v1/auth/registerthrottle:6,1User registration
POST /api/v1/auth/forgot-passwordthrottle:6,1Password reset request
POST /api/v1/auth/reset-passwordthrottle:6,1Password reset
POST /api/v1/marketing/*throttle:10,1Newsletter subscribe/unsubscribe
GET /healthBasic health check
GET /metricsPrometheus metrics
POST /webhooks/stripeVerifyStripeWebhookSignatureStripe webhooks

Tenant User (auth:sanctum)

RouteAdditional MiddlewarePurpose
POST /api/v1/auth/email/verifyVerify email
POST /api/v1/auth/email/resendthrottle:3,1Resend verification
POST /api/v1/onboarding/*VerifyEmailMiddlewareCheckout + provisioning
GET/POST /api/v1/account/*GDPR data export/deletion
GET/PUT /v1/billing/*ResolveTenantFromUserBilling portal

Admin (AuthenticateAdmin)

RouteAdditional MiddlewarePurpose
GET/POST/PATCH /api/v1/admin/tenants/*Tenant CRUD
* /api/v1/admin/tenants/{tenantId}/*ResolveTenantFromPathTenant-scoped admin actions — see below
GET /api/v1/admin/metricsPlatform metrics
GET /api/v1/admin/auditAudit log
GET /api/v1/admin/rate-limits/*Rate limit dashboard
GET/POST/PUT/DELETE /api/v1/admin/catalog/*Product catalog CRUD
GET/POST/PUT/DELETE /api/v1/admin/feature-flags/*Feature flags CRUD
GET/POST /api/v1/admin/subscriptions/*Subscription management
GET/POST /api/v1/admin/invoices/*Invoice management
* /api/v1/admin/billing/*AuthorizeBillingRoleBilling admin (role-gated)

Admin Tenant-Scoped (AuthenticateAdmin + ResolveTenantFromPath)

Mirrors every route under /api/v1/tenant/* so admins can manage any tenant's resources without SSH + tinker. ResolveTenantFromPath reads {tenantId} from the URL, validates the tenant is active, connects the tenant DB, and binds the Tenant on the request — identical downstream contract to ResolveTenantFromUser. The same Tenant\* controllers serve both flows.

RoutePurpose
GET /api/v1/admin/tenants/{tenantId}/productsList tenant products
GET /api/v1/admin/tenants/{tenantId}/products/{id}Read tenant product
GET/POST/PUT/DELETE /api/v1/admin/tenants/{tenantId}/licensesTenant license CRUD
GET /api/v1/admin/tenants/{tenantId}/activationsTenant activations
GET /api/v1/admin/tenants/{tenantId}/entitlementsTenant entitlements
GET/POST/DELETE /api/v1/admin/tenants/{tenantId}/api-keysTenant API keys
GET/PUT /api/v1/admin/tenants/{tenantId}/settingsTenant settings
GET /api/v1/admin/tenants/{tenantId}/audit-logsTenant audit log
GET/POST/PUT/DELETE /api/v1/admin/tenants/{tenantId}/webhooksWebhook endpoint CRUD
GET /api/v1/admin/tenants/{tenantId}/webhook-deliveriesWebhook delivery history
GET/POST /api/v1/admin/tenants/{tenantId}/notificationsTenant notifications
GET /api/v1/admin/tenants/{tenantId}/dev-tools/snapshotDeveloper tools snapshot

Audit attribution on this route group: every write routed through AuditService::log() records actor_type='admin', actor_id=<admin.id>, and appends _BY_ADMIN to the final segment of the event code (e.g. LICENSE.CREATED_BY_ADMIN, API_KEY.CREATED_BY_ADMIN). Tenant flow (/api/v1/tenant/*) continues to record actor_type='user' and plain event codes.

Billing Role Authorization (AuthorizeBillingRole)

HTTP MethodRequired LevelAllowed Roles
GETreadbilling_readonly, billing_admin, super_admin
POST, PUT, PATCH, DELETEwritebilling_admin, super_admin

Integration API (ResolveTenantFromApiKey + EnforceRateLimit)

RouteAuthPurpose
POST /api/v1/integration/*X-API-Key headerLicense/activation/entitlement/usage

Audit Coverage

All admin authentication events (login, logout, failed attempts, lockouts) are logged via AuditService. All billing authorization failures are logged via BillingAuthorizationLogService. The X-Request-ID header provides end-to-end traceability.

Built by Veltara Works