@deep/nest-kit
    Preparing search index...

    Interface BaseServiceMethodContext

    Context object for base service methods.

    interface BaseServiceMethodContext {
        isSilent?: boolean;
        requestId?: string;
        transaction?: EntityManager;
        user: CurrentUser;
        isGranted(
            action: string,
            actionScopes?: ActionScopes | ActionScopesArray,
        ): boolean;
        validateAccess(
            action: string,
            scopes?: ActionScopes | ActionScopesArray,
        ): void;
    }

    Hierarchy (View Summary)

    Index

    Properties

    isSilent?: boolean

    Make the request silent, meaning no notifications and actions will be sent.

    requestId?: string

    An optional request ID.

    transaction?: EntityManager

    Check permission and throw AccessDenied error if user doesn't have permission

    action string

    scopes where action was executed

    AccessDenied error if the user doesn't have the permission

    The current user making the request.

    Methods

    • Checks if the user has permission to perform the specified action.

      Parameters

      • action: string

        The action to check permission for.

      • OptionalactionScopes: ActionScopes | ActionScopesArray

        Optional scopes to check permission against.

      Returns boolean

      True if the user has permission, false otherwise.

    • Check permission and throw AccessDenied error if user doesn't have permission

      Parameters

      • action: string

        action string

      • Optionalscopes: ActionScopes | ActionScopesArray

        scopes where action was executed

      Returns void

      AccessDenied error if the user doesn't have the permission