ums

Role - Aggregate Architecture

Bounded Context: Authorization
Aggregate Root: Role
Module: Ums.Domain.Authorization.Role
Status: Production

Purpose

Role is the tenant-scoped master catalog of responsibilities defined by a SystemSuite. It supplies the governed role identifier referenced by permission templates and profiles, while supporting an optional hierarchy for promotion and administration.

Catalog Contract

Field Rule
Code Required and unique within SystemSuiteId; stable machine code.
Value Required display value used by administrators.
Description Functional explanation maintained with the catalog item.
ParentRoleId Optional role in the same system suite.
HierarchyLevel Root is 0; child is parent level plus one.
PromotionOrder Non-negative order used by role governance flows.
IsActive Lifecycle state; inactive records remain auditable.

Invariants

  1. TenantId and SystemSuiteId are mandatory ownership boundaries.
  2. A role code cannot be repeated in a system suite.
  3. A parent role must belong to the same system suite.
  4. Role parent relationships cannot form cycles.
  5. Role operations return Result failures for business conditions; they do not use exceptions for flow control.

Model

classDiagram
    class SystemSuite {
        +Guid Id
    }
    class Role {
        +Guid Id
        +Guid TenantId
        +Guid SystemSuiteId
        +Guid ParentRoleId
        +Code Code
        +Name Value
        +Description Description
        +int HierarchyLevel
        +int PromotionOrder
        +bool IsActive
        +Create()
        +Update()
        +Activate()
        +Deactivate()
    }
    SystemSuite "1" --> "0..*" Role : defines
    Role "0..1" --> "0..*" Role : parentOf

Application Contract

Persistence and Isolation

Back to Authorization Index