propylons-client
Version:
Client package for Propylons
17 lines (16 loc) • 600 B
TypeScript
/*!
* Propylons
* Copyright(c) 2022 Xavier Raffin
* MIT Licensed
*/
import { BaseToken, OwnershipContext } from "./model/Token";
/**
* Permission check main function.
* The method will throw if the type is not the expected one.
*
* @param actionName The action permission type
* @param token The token to check permission for (can be from API key or user)
* @param context the ownership context
* @returns whether the action is allowed for given user and dataForAction
*/
export declare function can<T extends BaseToken, E>(actionName: E, token?: T, context?: OwnershipContext): boolean;