Socket
Socket
Sign inDemoInstall

session-role-manager

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

session-role-manager

A session based role mannger for node-casbin.


Version published
Maintainers
1
Weekly downloads
79
decreased by-53.53%

Weekly downloads

Readme

Source

session-role-manager

NPM version NPM download Release

Session Role Manager is the Session-based role manager for node-casbin. With this library, node-casbin can load session-based role hierarchy (user-role mapping) from Casbin policy or save role hierarchy to it. The session is only active in the specified time range.

Installation

# Yarn
yarn add session-role-manager
# NPM
npm install session-role-manager --save

Example

import { newEnforcer } from 'casbin';
import { SessionRoleManager } from 'session-role-manager';

async function app() {
  const e = await newEnforcer('examples/rbac_model_with_sessions.conf', 'examples/rbac_policy_with_sessions.csv');

  // Use our role manager.
  const rm = new SessionRoleManager(10);
  e.setRoleManager(rm);
  await e.buildRoleLinks();
}

app();

Keywords

FAQs

Last updated on 23 May 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc