0.0.6 • Published 5 years ago

@paraboly/pwc-permission-service v0.0.6

Weekly downloads
12
License
MIT
Repository
github
Last release
5 years ago

Generic Permission Service with Jest Test via Paraboly

npm version npm Platform - Platform Free Web License: MIT

Architecture of Using Permission Service

TypesValuesExampleExample2
NAMESPACE0permissionpermission
MODULE1systemsystem
PAGE2globalMapglobalMap
COMPONENT3*button
COMPONENT ID4*delete_button
PERMISSION VALUE570

Installation

npm i @paraboly/pwc-permission-service

Usage

Import

import PermissionService from "@paraboly/pwc-permission-service";

Basic Usage

Generate Permission Object from Encoded Permission String

Generate (Decode) the given encoded permission string to usable object

const {
  generatePermissionObj,
} = PermissionService;

const permissionObj = generatePermissionObj(permission);
console.log("Permission Object: ", permissionObj);

Decode Selected Permission

Please check the permission architecture about the permission of the each type.

const {
  decodeSelectedPermission
} = PermissionService;

const module = decodeSelectedPermission(1, permission);
const page = decodeSelectedPermission(2, permission);
const permissionValue = decodeSelectedPermission(
  5,
  permission
);

Generate Permission Encode

Generate the fundamental encoded permission string with given parameters

PermissionService.generatePermissionEncode(
  "permission",
  "system",
  "globalMap",
  "*",
  "delete_button",
  7
)

Authors

FreakyCoder, kuray.ogun@paraboly.com | kurayogun@gmail.com

License

Permission Service is available under the Apache License 2.0 license. See the LICENSE file for more info.

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago