Skip to content

Latest commit

 

History

History
181 lines (81 loc) · 2.56 KB

core.clientwithprincipal.md

File metadata and controls

181 lines (81 loc) · 2.56 KB

Home > @cerbos/core > ClientWithPrincipal

ClientWithPrincipal class

A client instance with a pre-specified principal.

Signature:

export declare class ClientWithPrincipal<ClientType extends Client = Client> 

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the ClientWithPrincipal class.

Properties

Property

Modifiers

Type

Description

auxData

readonly

Pick<AuxData, "jwt">

Auxiliary data related to the principal for whom this instance was created.

client

readonly

ClientType

The client from which this instance was created.

principal

readonly

Principal

The principal for whom this instance was created.

Methods

Method

Modifiers

Description

checkResource(request, options)

Check the principal's permissions on a resource. See Client.checkResource() for details.

checkResources(request, options)

Check the principal's permissions on a set of resources. See Client.checkResources() for details.

isAllowed(request, options)

Check if the principal is allowed to perform an action on a resource. See Client.isAllowed() for details.

planResources(request, options)

Produce a query plan that can be used to obtain a list of resources on which the principal is allowed to perform a particular action. See Client.planResources() for details.