Comparing version 2.0.3 to 2.0.4
@@ -166,3 +166,3 @@ import { ManagementEnforcer } from './managementEnforcer'; | ||
*/ | ||
getImplicitPermissionsForUser(user: string): string[][]; | ||
getImplicitPermissionsForUser(user: string, ...domain: string[]): string[][]; | ||
} |
@@ -311,7 +311,13 @@ "use strict"; | ||
*/ | ||
getImplicitPermissionsForUser(user) { | ||
const roles = [user, ...this.getImplicitRolesForUser(user)]; | ||
getImplicitPermissionsForUser(user, ...domain) { | ||
const roles = [user, ...this.getImplicitRolesForUser(user, ...domain)]; | ||
const res = []; | ||
const withDomain = domain && domain.length !== 0; | ||
roles.forEach(n => { | ||
res.push(...this.getPermissionsForUser(n)); | ||
if (withDomain) { | ||
res.push(...this.getFilteredPolicy(0, n, ...domain)); | ||
} | ||
else { | ||
res.push(...this.getPermissionsForUser(n)); | ||
} | ||
}); | ||
@@ -318,0 +324,0 @@ return res; |
{ | ||
"name": "casbin", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "An authorization library that supports access control models like ACL, RBAC, ABAC in Node.JS", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
170198
3790