/** * @slynova/fence * * @license MIT * @copyright Slynova - Romain Lanz */ import { Bouncer } from '../Bouncer'; import { TResource } from '../Contracts'; declare class Guard { /** * User to test. */ private readonly $user; /** * Constructor. * * @param user User to test. */ constructor(user: Function | object); /** * Creates a Bouncer with the given user. * * @param user User to test */ static can(user: Function | object): Bouncer; /** * Sets a default user for any call. * * @param user User to test */ static setDefaultUser(user: Function | object): Guard; /** * Check the bouncer if the gate/policy allows the user. * * @param ability Ability to test * @param resource Resource to test * @param user Optional. User to verify */ allows(ability: string, resource: TResource, user: Function | object | undefined): boolean; /** * Creates a Bouncer with the given user. * * @param user User to test */ can(user: Function | object): Bouncer; /** * Check the bouncer if the gate/policy denies the user. * * @param ability Ability to test * @param resource Resource to test * @param user Optional. User to verify */ denies(ability: string, resource: TResource, user: Function | object | undefined): boolean; /** * Verifies if the resource has a policy assiociated. * * @param resource Resource to verify */ private $correspondsToPolicy; } export { Guard };