credentials-sofair
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

USAGE

import { Credentials } from './credentials';

const user = { id:1, username: 'user', roles: ['admin', 'moderator'] }; const resources = { 'resource_': { id: 1, rn: 'resource_' }, 'resource_1': { id: 2, rn: 'resource_1' } };

const credentials = new Credentials(user, resources);

credentials.hasResource('resource'); // call without id, return boolean

credentials.hasResource('resource', 2); // call with id, return boolean

credentials.getUser(); // return user

credentials.getResources(); // return resources

Readme

Keywords

none

Package Sidebar

Install

npm i credentials-sofair

Weekly Downloads

4

Version

0.0.2

License

Apache-2.0

Unpacked Size

15.3 kB

Total Files

8

Last publish

Collaborators

  • almashi