# @types/easy-rbac

> TypeScript definitions for easy-rbac

Latest version **3.1.5** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/easy-rbac
pnpm add @types/easy-rbac
yarn add @types/easy-rbac
bun add @types/easy-rbac
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 3.1.5 |
| Published | 2023-11-07 |
| First published | 2020-03-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51438 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/easy-rbac
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/easy-rbac
- npm.io page: https://npm.io/package/@types/easy-rbac

## Recent versions

- 3.1.5 (latest) — 2023-11-07
- 3.1.2 (ts3.8) — 2021-12-23
- 3.1.1 (ts3.6) — 2021-07-08
- 3.1.0 (ts2.8) — 2020-03-27
- 3.1.4 — 2023-10-18
- 3.1.3 — 2023-09-23

## README

# 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](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/easy-rbac/index.d.ts)
````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 .

---
_Source: https://npm.io/package/@types/easy-rbac · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
