Class ApiClient

This interface contains read actions that goes outside of your local network and queries permit.io cloud api. You should be aware that these actions incur some cross-cloud latency.

See

DeprecatedApiClient for implementation and docs.

Hierarchy

Implements

Constructors

Properties

API for managing resource action groups.

conditionSetRules: IConditionSetRulesApi

API for managing condition set rules.

conditionSets: IConditionSetsApi

API for managing condition sets.

environments: IEnvironmentsApi

API for managing environments.

projects: IProjectsApi

API for managing projects.

relationshipTuples: IRelationshipTuplesApi

API for managing relationship tuples.

resourceActions: IResourceActionsApi

API for managing resource actions.

resourceAttributes: IResourceAttributesApi

API for managing resource attributes.

resourceInstances: IResourceInstancesApi

API for managing resource instances.

resourceRelations: IResourceRelationsApi

API for managing resource relations.

resourceRoles: IResourceRolesApi

API for managing resource roles.

resources: IResourcesApi

API for managing resources.

roleAssignments: IRoleAssignmentsApi

API for managing role assignments.

roles: IRolesApi

API for managing roles.

tenants: ITenantsApi

API for managing tenants.

users: IUsersApi

API for managing users.

Methods

  • Ensure that the API Key has the necessary permissions to successfully call the API endpoint. Note that this check is not foolproof, and the API may still throw 401.

    Parameters

    • requiredAccessLevel: ApiKeyLevel

      The required API Key Access level for the endpoint.

    Returns Promise<void>

    Throws

    PermitContextError If the currently set API key access level does not match the required access level.

  • Ensure that the API context matches the required endpoint context.

    Parameters

    • requiredContext: ApiContextLevel

      The required API context level for the endpoint.

    Returns Promise<void>

    Throws

    PermitContextError If the currently set API context level does not match the required context level.

  • Retrieves the assigned roles for a user (either in a single tenant or in all tenants).

    Parameters

    • user: string

      The ID or key of the user.

    • Optional tenant: string

      The ID or key of the tenant, optional. If provided, only roles assigned within this tenant will be returned.

    Returns Promise<RoleAssignmentRead[]>

    A promise that resolves to an array of RoleAssignmentRead objects representing the assigned roles.

    Throws

    PermitApiError If the API returns an error HTTP status code.

    Throws

    PermitContextError If the configured ApiContext does not match the required endpoint context.

    Deprecated

    replaced with permit.api.users.getAssignedRoles()

Generated using TypeDoc