Interface IRolesApi

Hierarchy

  • IRolesApi

Implemented by

Methods

  • Assigns permissions to a role.

    Parameters

    • roleKey: string

      The key of the role.

    • permissions: string[]

      An array of permission keys (resourceKey:actionKey) to be assigned to the role.

    Returns Promise<RoleRead>

    A promise that resolves to a RoleRead object representing the updated role.

    Throws

    PermitApiError If the API returns an error HTTP status code.

    Throws

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

  • Deletes a role.

    Parameters

    • roleKey: string

      The key of the role to delete.

    Returns Promise<void>

    A promise that resolves when the role is deleted.

    Throws

    PermitApiError If the API returns an error HTTP status code.

    Throws

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

  • Retrieves a role by its key. Alias for the get method.

    Parameters

    • roleKey: string

      The key of the role.

    Returns Promise<RoleRead>

    A promise that resolves to the role.

    Throws

    PermitApiError If the API returns an error HTTP status code.

    Throws

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

  • Removes permissions from a role.

    Parameters

    • roleKey: string

      The key of the role.

    • permissions: string[]

      An array of permission keys (resourceKey:actionKey) to be removed from the role.

    Returns Promise<RoleRead>

    A promise that resolves to a RoleRead object representing the updated role.

    Throws

    PermitApiError If the API returns an error HTTP status code.

    Throws

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

Generated using TypeDoc