# SPDX-License-Identifier: LicenseRef-NativeMindNONC
# Scopes and roles (02e §3.6), machine-readable. Roles are scope bundles; every OpenAPI operation's x-scope, every
# GraphQL @auth, every topic scope and every OSC address scope is one of `scopes` or a pseudo scope (checked by
# tools/parity/check.mjs). From flutter_freedome FreeDomeUserRole / FreeDomePermission (models/dome_models.dart:50-65).
version: 1
pseudoScopes:
  anon: no credentials needed (an installation may also allow anonymous `guest` = kiosk mode)
  any: any authenticated principal (resource-level ownership rules apply, e.g. own jobs / clients)
scopes:
  info:read: server info, venues, displays, engines, nodes, devices (read)
  events:subscribe: subscribe to topics / GET /events
  playback:read: players, output, audio state, parameters (read)
  content:read: shows, assets, presets, scenarios (read), exports, downloads
  playback:control: play / pause / seek / output / parameters / cues / scenario sessions
  apps:publish: ecosystem-app payloads
  content:write: assets, uploads, imports, shows, presets
  audio:control: audio mode / gain / zones / devices / sessions / generator / sources
  displays:control: test patterns, identify, power
  calibration:run: visual calibration jobs and sidecars
  audio:calibrate: audio calibration jobs (audio-room, audio-speaker-check)
  venues:write: venues, displays config, speaker layout, device pairing / binding
  gateways:manage: gateways, OSC send
  system:read: system status, logs, config (redacted), diagnostics, clients, jobs of others
  users:manage: local users, pairing approval
  keys:manage: API keys
  system:admin: reboot / shutdown / update / restore / config write / engine restart / backend / scenario enable
roles:
  guest:
    scopes: [info:read, events:subscribe, playback:read, content:read]
    conditional:
      - scopes: [playback:control, apps:publish]
        when: the venue allows guest control (config `[auth] guest_control = true`, kiosk / ecosystem apps)
  operator:
    inherits: guest
    scopes: [playback:control, apps:publish, content:write, audio:control, displays:control]
  admin:
    inherits: operator
    scopes: [calibration:run, audio:calibrate, venues:write, gateways:manage, system:read, users:manage, keys:manage]
  superadmin:
    inherits: admin
    scopes: [system:admin]
listeners:
  osc: fixed role per listener (default operator; admin only on the admin CIDR list)
  legacy: pairing token in `auth.token` / `?token=`, or the anonymous guest policy
