0.1.0 • Published 2 years ago
@syccure/authorization v0.1.0
Node Syccure Authentication
This Package for communication the syccure platform for authorization of users based on permissions.
For Build
- yarn node-authorization:build
- publish dist folder to npmjs
Usage:
npm i --save @syccure/authorization
import Validator from '@syccure/authorization'
/**
* @param mode = <"sandbox" | "production">
* @param clientId = <prodived from syccure platform>
*/
validation = Validator.build(mode, clientId)
/**
* @param userId = <Which is registered as identity>
* @param assetName = <Which you registered in assets section>
* @param permission = <"read" | "write" | "edit" | "delete">
* @return {is_allowed} = true | false is true that means a person who sends request is authorized and if false then not.
*/
const {is_allowed} = validation.rbac(userId, assetName, permission);