1.0.30 • Published 12 months ago

@baasi/permission-builder v1.0.30

Weekly downloads
-
License
ISC
Repository
-
Last release
12 months ago

Installing

$ npm install

Once the package is installed, you can import the library using import or require approach:

import PermissionBuilder from "@baasi/permission-builder"

Examples

//Example(1) initialize PermissionBuilder using default permission blocks endpoint.
const permissionBuilder = new permissionBuilder();
await permissionBuilder.initPermissions();

//Example(2) initialize permission builder using PermissionBlocks type object.
const permissonBlocks: PermissionBlocks = {
    '1': {
        meeting_create: 1,
        meeting_list: 2,
        meeting_info: 4,
        meeting_delete: 8
    },
    '2': {
        meeting_stop: 1,
        meeting_upgrade: 2,
    }
        //e.t.c
}
const permissionBuilder = new permissionBuilder(permissonBlocks);
await permissionBuilder.initPermissions();

//Example(3) initialize PermissionBuilder using third party endpoint.
//If you need to use your own endpoint, response data should be in json of the following format.
{
  "data": {
    "1": {
      "meeting_create": 1,
      "meeting_list": 2,
      "meeting_info": 4,
      "meeting_delete": 8
    },
    "2": {
      "meeting_info": 1,
      "meeting_upgrade": 2
    }
  }
}
const permissionBuilder = new permissionBuilder();
const httpOptions: PermissionBuilderOptionsInterface = {
    url: 'https://third-party-url.com',
    method: 'get',
    headers: {"Content-Type": "application/json"}
}
await permissionBuilder.initPermissions(httpOptions);
1.0.29

12 months ago

1.0.28

1 year ago

1.0.27

1 year ago

1.0.22

1 year ago

1.0.30

12 months ago

1.0.26

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.21

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.20

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago