Skip to content

Roles & Access Control

EaseLab uses role-based access control (RBAC) at two levels: tenant roles for lab staff and platform roles for SaaS operators.

Tenant-level RBAC

Role types

TypePermissionsNotes
Tenant AdminAll permissionsAssigned to lab owner; cannot be restricted
Custom rolesSelected permissionsCreated in Admin → Roles
System rolesPre-defined setsSeeded on tenant provisioning (Receptionist, Technician, etc.)

Permission model

Permissions follow the pattern module.action:

ActionCode suffixExample
View.viewinvoices.view
Create.createpatients.create
Edit.edittests.edit
Delete.deleteinvoices.delete

Legacy .manage codes grant create, edit, and delete for a module.

Permission groups

GroupModules (examples)
Adminusers, roles, catalog, settings, backups, crm
Billinginvoices, referrals, rate_lists, deleted_invoices
Patientspatients, samples, results_entry, result_verification, report_delivery
Salesstock, consumption, expenses
Financeledgers, cash_management, salary_management
Reportanalytics, top_tests, pending_samples
Subscriptionsubscription (view only)
Quick Accessquick.create_invoice, quick.send_sms, quick.verify_results

Retrieve the full catalog via GET /lab/admin/permissions. Check current user access via GET /lab/admin/access.

API enforcement

Controllers call ITenantAccessService.EnsurePermissionAsync before sensitive operations. Missing permission returns HTTP 403 with You do not have permission to perform this action.

Platform-level RBAC

Platform admins have roles with scoped permissions:

Platform roleKey permissions
SuperAdminAll platform permissions
AdminTenants, billing, plans, CRM, backups, impersonation
SupportView tenants, impersonate, CRM
BillingView tenants, manage billing
ViewerView tenants only

Platform permission codes

CodeCapability
platform.tenants.viewList and view tenants
platform.tenants.manageCreate, edit, lock, provision
platform.tenants.billingSubscription and payment status
platform.tenants.impersonateSign in as tenant owner
platform.users.managePlatform admin users
platform.plans.manageSubscription packages
platform.crm.managePlatform CRM leads
platform.backups.manageBackup settings and restore

Default system roles

On provisioning, EaseLab seeds roles such as:

RoleTypical use
ReceptionistPatients, invoices, payments
Lab TechnicianSamples, result entry
PathologistResult verification, report approval
AccountantLedgers, expenses, reports

Customize or add roles in Admin → Roles & Permissions. See Manage Roles.

Tenant Admin policy

Endpoints marked with the TenantAdmin authorization policy require the user to be either:

  • IsTenantAdmin = true (owner), or
  • IsPlatformAdmin = true (during impersonation)

Some endpoints additionally check specific permission codes.

Ease Lab — Cloud Pathology Lab Management