# Module: Azaion.Common.Entities.RoleEnum ## Purpose Defines the authorization role hierarchy for the system. > **Cycle 2 (2026-05-14) note** — `Service = 60` added by AZ-535 for service-to-service verifier identities (satellite-provider, gps-denied, ui). Each verifier deployment provisions one `Role=Service` user; the role is gated to read `/sessions/revoked` only (via `revocationReaderPolicy`) and is not valid for any user-facing endpoint. ## Public Interface | Enum Value | Int Value | Description | |-----------|-----------|-------------| | `None` | 0 | No role assigned | | `Operator` | 10 | Annotator access only; can send annotations to queue | | `Validator` | 20 | Annotator + dataset explorer; can receive annotations from queue | | `CompanionPC` | 30 | Companion PC role (UAV / aircraft identities; AZ-533 mission tokens are bound to these via `aircraft_id`) | | `Admin` | 40 | Admin role | | `ResourceUploader` | 50 | Data-only — `apiUploaderPolicy` was removed in the post-cycle-1 AZ-183 revert. The seed `uploader@azaion.com` user keeps this role for negative-auth tests. | | `Service` | 60 | AZ-535 — service-to-service identity for verifiers polling `/sessions/revoked`. NOT valid for any user-facing endpoint. | | `ApiAdmin` | 1000 | Full access to all operations | ## Internal Logic Integer values define a loose hierarchy; higher values don't necessarily imply more permissions — policy-based authorization in `Program.cs` maps specific roles to policies. ## Dependencies None. ## Consumers - `User.Role` property type - `RegisterUserRequest.Role` property type - `Program.cs` — authorization policies (`apiAdminPolicy`, `revocationReaderPolicy` cycle 2) - `AuthService.CreateToken` — embeds role as claim - `AzaionDbSchemaHolder` — maps Role to/from text in DB (text enum → `Enum.Parse(typeof(RoleEnum), v)`; the new `Service` value parses through the existing converter without migration) - `UserService.GetUsers` — filters by role - `UserService.ChangeRole` — updates user role - `MissionTokenService.Issue` — validates `aircraft_id` resolves to a `CompanionPC` user - `Program.cs` `IssueDualTokens` — fires `RevokeMissionsForAircraft` when the authenticated user has `Role = CompanionPC` ## Data Models Part of the `User` entity. ## Configuration None. ## External Integrations None. ## Security Core to the RBAC authorization model. `ApiAdmin` has unrestricted access; `Service` is narrowly scoped to the `/sessions/revoked` verifier-poll feed; `ResourceUploader` is data-only after AZ-183 was reverted; other roles have endpoint-level restrictions. ## Tests None.