-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1fc1bf3
commit b5f8d15
Showing
10 changed files
with
39 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "angular-permission", | ||
"version": "5.3.2", | ||
"version": "6.0.0", | ||
"authors": [ | ||
"Rafael Vidaurre <[email protected]> (http://www.rafaelvidaurre.com)", | ||
"Blazej Krysiak <[email protected]>" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/** | ||
* angular-permission-ng | ||
* Extension module of angular-permission for access control within angular-route | ||
* @version v5.3.2 - 2017-05-29 | ||
* @version v6.0.0 - 2018-01-20 | ||
* @link https://github.com/Narzerus/angular-permission | ||
* @author Rafael Vidaurre <[email protected]> (http://www.rafaelvidaurre.com), Blazej Krysiak <[email protected]> | ||
* @license MIT License, http://www.opensource.org/licenses/MIT | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/** | ||
* angular-permission-ui | ||
* Extension module of angular-permission for access control within ui-router | ||
* @version v5.3.2 - 2017-05-29 | ||
* @version v6.0.0 - 2018-01-20 | ||
* @link https://github.com/Narzerus/angular-permission | ||
* @author Rafael Vidaurre <[email protected]> (http://www.rafaelvidaurre.com), Blazej Krysiak <[email protected]> | ||
* @license MIT License, http://www.opensource.org/licenses/MIT | ||
|
@@ -412,12 +412,18 @@ | |
function resolveExceptStatePermissionMap(deferred, map) { | ||
var exceptPromises = resolveStatePermissionMap(map.except, map); | ||
|
||
$q.all(exceptPromises) | ||
.then(function (rejectedPermissions) { | ||
deferred.reject(rejectedPermissions[0]); | ||
}) | ||
.catch(function () { | ||
// Reverse the promises, so if any "except" privileges are not met, the promise rejects | ||
$q.all(reversePromises(exceptPromises)) | ||
.then(function () { | ||
resolveOnlyStatePermissionMap(deferred, map); | ||
}) | ||
.catch(function (rejectedPermissions) { | ||
|
||
if (!angular.isArray(rejectedPermissions)) { | ||
rejectedPermissions = [rejectedPermissions]; | ||
} | ||
|
||
deferred.reject(rejectedPermissions[0]); | ||
}); | ||
} | ||
|
||
|
@@ -472,6 +478,23 @@ | |
}); | ||
}); | ||
} | ||
|
||
/** | ||
* Creates an Array of Promises that resolve when rejected, and reject when resolved | ||
* @methodOf permission.ui.PermStateAuthorization | ||
* @private | ||
* | ||
* @param promises {Array} Array of promises | ||
* | ||
* @returns {Array<Promise>} Promise collection | ||
*/ | ||
function reversePromises(promises) { | ||
return promises.map(function (promise) { | ||
var d = $q.defer(); | ||
promise.then(d.reject, d.resolve); | ||
return d.promise; | ||
}); | ||
} | ||
} | ||
|
||
angular | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.