Class RoleProps
B.3 — first-class role entity. Roles exist independently of groups and
claim mappers: they're a named bucket of access an operator can assign
to a user (directly) or to a group (transitively to every member).
Three layers in our token-issuance pipeline now compose orthogonally:
Claim mappers () — declarative
rules that translate user attributes / group membership into JWT
claims at sign-in time. Mappers are the WIRING layer.Groups () — hierarchical user
organisation; can carry per-membership role labels via
. Groups are the MEMBERSHIP layer.Roles (this entity) — first-class named access buckets,
audience-scoped (organization-wide OR per-application). Assigned
directly to users via or
transitively via groups via .
Roles are the ACCESS layer that operators reason about.
Token issuance walks the user's EFFECTIVE role set = direct user
assignments ∪ transitive assignments via every group the user belongs to
(including ancestor groups when claim mappers expand the tree). For
audience='application' roles the set is FILTERED to the client_id of the
token being issued — an "engineering-admin" role on app A doesn't leak
into a token issued for app B.
Uniqueness: (Name, Audience, ApplicationId) is unique. Built-in roles
(system / everyone / admin / impersonator) are seeded with
=true and can't be deleted via the admin API.
[RedbScheme("identity.role")]
public class RoleProps
Inheritance
Properties
ApplicationId
FK to the Application object id when = "application". Null for organization.
public long? ApplicationId { get; set; }
Audience
"organization" — visible to every application in this Identity
public string Audience { get; set; }
Description
public string? Description { get; set; }
IsSystem
True for system-seeded roles (system / everyone / admin / impersonator)
public bool IsSystem { get; set; }