3.1.5 • Published 6 months ago

@types/easy-rbac v3.1.5

Weekly downloads
166
License
MIT
Repository
github
Last release
6 months ago

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.

3.1.3

8 months ago

3.1.5

6 months ago

3.1.4

7 months ago

3.1.2

2 years ago

3.1.1

3 years ago

3.1.0

4 years ago