3.1.5 • Published 6 months ago
@types/easy-rbac v3.1.5
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
// Type definitions for easy-rbac 3.1
// Project: https://github.com/DeadAlready/easy-rbac
// Definitions by: DefinitelyTyped <https://github.com/DefinitelyTyped>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
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: Thu, 23 Dec 2021 23:34:33 GMT
- Dependencies: none
- Global values: none
Credits
These definitions were written by DefinitelyTyped.