chore(release): 0.1.0 [skip ci]

# [0.1.0](https://github.com/node-casbin/session-role-manager/compare/v0.0.2...v0.1.0) (2026-02-02)

### Bug Fixes

* Changed string to Date for SessionRole time. ([3d995de](https://github.com/node-casbin/session-role-manager/commit/3d995defabd94c1dbddcd1f42fe7b1cb3b411ba2))

### Features

* add CI semantic-release for npm and GitHub ([#6](https://github.com/node-casbin/session-role-manager/issues/6)) ([2464c1a](https://github.com/node-casbin/session-role-manager/commit/2464c1a6d1d30f77a7e55865678a2c9d1760f131))
* modernize CI workflow and README, fix the code ([3a63d70](https://github.com/node-casbin/session-role-manager/commit/3a63d70d8cadbd91210d75f5a061146ba30b7aaf))
2 files changed
tree: d56f1711cbb189c822307c08a10825725517bddf
  1. .github/
  2. examples/
  3. src/
  4. test/
  5. .gitignore
  6. .prettierignore
  7. .prettierrc
  8. .releaserc.json
  9. CHANGELOG.md
  10. jest.config.js
  11. LICENSE
  12. package.json
  13. README.md
  14. tsconfig.json
README.md

Session Role Manager

CI NPM version NPM download Discord

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

npm install session-role-manager

Simple 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();