Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

shiro-perms

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shiro-perms

Apache Shiro permission style using Trie data structure

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
132
decreased by-40.54%
Maintainers
1
Weekly downloads
 
Created
Source

Shiro Perms

Create, check and manipulate permissions using a Trie data object and Apache Shiro write style.

Getting Started

Module exposes a class that can be used to create permissions objects. Each instance object represents a set of credentials which can be manipulated and verified using instance methods.

const ShiroPerms = require('shiro-perms');
import ShiroPerms from 'shiro-perms';

Documentation API

  • https://rjblopes.github.io/shiro-perms

Installing

Use:

npm i shiro-perms

Or

yarn add shiro-perms

Running the tests

Use:

npm run test

Or

yarn test

Usage

Create

Using class constructor:

const perms = new ShiroPerms();

Static methods:

const perms = ShiroPerms.from('store:view,edit store:*:1123');
const perms = ShiroPerms.from(['store:view,edit', 'store:*:1123']);

Check

Check ALL permissions - AND

perms.check('store:view:9999')
// True

perms.check('store:view store:edit:*')
// True

perms.check(['store:view', 'store:edit:9999'])
// False

Check ANY permissions - OR

perms.checkAny(['store:view', 'store:edit:9999'])
// True

Add

....

Remove

...

Reset

...

Built With

  • msgpack5 - A msgpack v5 implementation for node.js

Author

License

This project is licensed under the MIT License

Acknowledgments

Keywords

FAQs

Package last updated on 31 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc