Member Junction
    Preparing search index...

    Stores the fundamental permissions and access rights that can be granted to users and roles throughout the system.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    __mj_CreatedAt: Date = null

    Timestamp when the authorization was created

    __mj_UpdatedAt: Date = null

    Timestamp when the authorization was last updated

    Description: string = null

    Description of the authorization

    ID: string = null

    Unique identifier for the authorization

    IsActive: boolean = null

    Indicates whether this authorization is currently active and can be granted to users or roles

    Name: string = null

    Name of the authorization

    Parent: string

    Name of the parent authorization

    ParentID: string = null

    The unique identifier for the parent authorization, if applicable

    UseAuditLog: boolean = null

    When set to 1, Audit Log records are created whenever this authorization is invoked for a user

    Accessors

    • get Roles(): AuthorizationRoleInfo[]

      Returns the role assignments for this authorization.

      Lazy resolution — filters from the global Metadata.Provider.AuthorizationRoles collection on every call, like QueryInfo.Permissions filters from Metadata.Provider.QueryPermissions. No result caching is applied because AuthorizationRoleInfo objects are lightweight and the collection is small.

      Returns AuthorizationRoleInfo[]

    Methods

    • Copies initialization data from a plain object to the class instance. Only copies properties that already exist on the class to prevent creating new fields. Special handling for DefaultValue fields to extract actual values from SQL Server syntax.

      Parameters

      • initData: any

        The initialization data object

      Returns void

    • Determines if a given role can execute actions under this authorization.

      Phase 2b also honours Deny semantics for consistency with UserCanExecute.

      Parameters

      • role: RoleInfo

        The role to check for execution rights.

      Returns boolean

      True if an Allow authorization-role exists for this role and no Deny does.

    • Default JSON serialization for BaseInfo subclasses.

      Emits all non-underscored direct field declarations. For _-prefixed private backing fields (the MJ pattern for collection storage — e.g. _Fields, _RelatedEntities, _OrganicKeys), emits the value of the corresponding same-named public getter instead. Purely computed getters without a backing field (display-name formatters, derived flags) are intentionally skipped — they can throw when source fields are null and don't belong on the wire anyway.

      Nested BaseInfo instances and arrays of them unwrap automatically via JSON.stringify's native toJSON() protocol.

      Subclasses may override to emit a filtered subset or custom shape (see EntityFieldValueInfo).

      Returns Record<string, unknown>

    • Determines if a given user can execute actions under this authorization based on their roles.

      Evaluation rules (fixed in Phase 2b):

      • Match by AuthorizationRoleInfo.RoleID (the FK to Roles), not the authorization-role PK.
      • Honour the Type column: any matching Deny row wins; without a Deny, at least one Allow is required.

      Parameters

      • user: UserInfo

        The user to check for execution rights.

      Returns boolean

      True if the user has a matching Allow role and no matching Deny role; false otherwise.