Installation
npm install --save @types/easy-rbac
Summary
This package contains type definitions for easy-rbac (https://github.com/DeadAlready/easy-rbac).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/easy-rbac.
index.d.ts
interface RoleObject {
name: string;
when: (params: object) => Promise<boolean>;
}
interface Roles {
[key: string]: {
can: Array<string | RoleObject>;
inherits?: string[] | undefined;
};
}
type Options = Roles | (() => Promise<Roles>) | Promise<Roles>;
declare class RBAC {
constructor(opts: Options);
can(role: string | string[] | Roles[], operation: string, params?: object): Promise<boolean>;
static create(opts: Options): RBAC;
}
export = RBAC;
Additional Details
- Last updated: Mon, 06 Nov 2023 22:41:05 GMT
- Dependencies: none
Credits
These definitions were written by .