Skip to content

Commit

Permalink
Fixed the 'SimplePathPrivilegeManager' class
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrienCastex committed Jul 2, 2017
1 parent e95de1a commit 25a9529
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/user/v2/privilege/SimplePathPrivilegeManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ var __extends = (this && this.__extends) || (function () {
})();
Object.defineProperty(exports, "__esModule", { value: true });
var PrivilegeManager_1 = require("./PrivilegeManager");
var export_1 = require("../../../manager/v2/export");
var Errors_1 = require("../../../Errors");
function standarizePath(path) {
if (!path)
Expand Down Expand Up @@ -64,7 +63,7 @@ var SimplePathPrivilegeManager = (function (_super) {
SimplePathPrivilegeManager.prototype._can = function (fullPath, user, resource, privilege, callback) {
if (!user)
return callback(null, false);
var rights = this.getRights(user, export_1.Path.toString());
var rights = this.getRights(user, fullPath.toString());
var can = !!rights && rights.some(function (r) { return r === 'all' || r === privilege; });
callback(null, can);
};
Expand Down
2 changes: 1 addition & 1 deletion src/user/v2/privilege/SimplePathPrivilegeManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class SimplePathPrivilegeManager extends PrivilegeManager
if(!user)
return callback(null, false);

const rights = this.getRights(user, Path.toString());
const rights = this.getRights(user, fullPath.toString());
const can = !!rights && rights.some((r) => r === 'all' || r === privilege);
callback(null, can);
}
Expand Down

0 comments on commit 25a9529

Please sign in to comment.