Cerbos JavaScript SDK
    Preparing search index...

    Class CheckResourcesResult

    The outcome of checking a principal's permissions on single resource.

    Index

    Properties

    actions: Record<string, Effect>

    The policy decisions for each action.

    metadata: CheckResourcesResultMetadata | undefined

    Additional information about how the policy decisions were reached.

    undefined if includeMetadata was false.

    outputs: OutputResult[]

    User-defined outputs from policy rule evaluations.

    Requires the Cerbos policy decision point server to be at least v0.27.

    The resource that was checked.

    validationErrors: ValidationError[]

    Any schema validation errors for the principal or resource attributes.

    Methods

    • Check if the policy decision was that a given action should be allowed for the resource.

      Parameters

      • action: string

        The action to check.

      Returns boolean | undefined

      undefined if the action is not present in the results.

    • Find the value of the user-defined output for a particular policy rule.

      Parameters

      • source: string

        The identifier of the policy rule that produced the output.

      Returns Value | undefined

      undefined if the result does not include an output for the source.

      Requires the Cerbos policy decision point server to be at least v0.27.