namespace ZB.MOM.WW.ScadaBridge.Security; /// /// Single source of truth for role-name string literals used across the /// Security module and downstream authorization checks. /// /// /// /// Role names appear in three independent contexts: /// (LDAP-group → role resolution), /// (policy RequireClaim values + the audit role arrays), and at LDAP /// mapping rows configured by an operator. Holding the literals here means a /// rename either succeeds everywhere or fails to compile, eliminating the /// "string drift" class. /// /// /// Canonicalization (auth normalization): role VALUES were /// standardized onto the canonical six (Viewer/Operator/Engineer/Designer/ /// Deployer/Administrator; only four are used by ScadaBridge). The legacy /// ScadaBridge role names were renamed/collapsed as follows: /// /// AdminAdministrator /// DesignDesigner /// DeploymentDeployer /// AuditAdministrator (COLLAPSE — accepted /// separation-of-duties loss; a former audit-only user gains the full admin /// surface) /// AuditReadOnlyViewer (COLLAPSE — keeps /// audit-read + nav, loses bulk export, which it never had) /// /// Engineer exists in the canonical vocabulary but is unused by /// ScadaBridge, so it is intentionally not declared here. Operator is /// now declared for the two-person Secured Writes feature. /// /// /// Secured Writes: Operator initiates a secured write and /// Verifier approves it — two distinct global roles so a single principal /// cannot both initiate and approve (separation of duties). Both are coarse /// global roles, matching the existing role model; site scoping (if any) is /// layered on at the LDAP-mapping level like the other roles. /// /// public static class Roles { public const string Administrator = "Administrator"; public const string Designer = "Designer"; public const string Deployer = "Deployer"; public const string Viewer = "Viewer"; /// Initiates a two-person Secured Write. Canonical /// vocabulary role; pairs with who approves. public const string Operator = "Operator"; /// Approves a two-person Secured Write. Held by a /// principal distinct from the initiating . public const string Verifier = "Verifier"; /// All declared ScadaBridge roles — the single source of truth for "all /// permissions" (e.g. the dev auto-login principal). Stays in sync if a role is added. public static readonly string[] All = [Administrator, Designer, Deployer, Viewer, Operator, Verifier]; }