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

casbin

Package Overview
Dependencies
Maintainers
3
Versions
135
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

casbin - npm Package Compare versions

Comparing version 1.1.4 to 1.1.5

12

lib/rbac/defaultRoleManager.js

@@ -97,8 +97,18 @@ "use strict";

getUsers(name, ...domain) {
if (domain.length === 1) {
name = domain[0] + '::' + name;
}
else if (domain.length > 1) {
throw new Error('error: domain should be 1 parameter');
}
if (!this.hasRole(name)) {
throw new Error('error: name does not exist');
}
return [...this.allRoles.values()]
let users = [...this.allRoles.values()]
.filter(n => n.hasDirectRole(name))
.map(n => n.name);
if (domain.length === 1) {
users = users.map(n => n.substring(domain[0].length + 2, n.length));
}
return users;
}

@@ -105,0 +115,0 @@ /**

2

package.json
{
"name": "casbin",
"version": "1.1.4",
"version": "1.1.5",
"description": "An authorization library that supports access control models like ACL, RBAC, ABAC in Node.JS",

@@ -5,0 +5,0 @@ "main": "lib/casbin.js",

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