Skip to content

Commit

Permalink
chore: Bump version to 6.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
masterspambot committed Jan 20, 2018
1 parent 1fc1bf3 commit b5f8d15
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 16 deletions.
2 changes: 1 addition & 1 deletion bower.json
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 <narzerus@gmail.com> (http://www.rafaelvidaurre.com)",
"Blazej Krysiak <blazej.krysiak@gmail.com>"
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-permission-ng.js
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 <narzerus@gmail.com> (http://www.rafaelvidaurre.com), Blazej Krysiak <blazej.krysiak@gmail.com>
* @license MIT License, http://www.opensource.org/licenses/MIT
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-permission-ng.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 29 additions & 6 deletions dist/angular-permission-ui.js
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 <narzerus@gmail.com> (http://www.rafaelvidaurre.com), Blazej Krysiak <blazej.krysiak@gmail.com>
* @license MIT License, http://www.opensource.org/licenses/MIT
Expand Down Expand Up @@ -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]);
});
}

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions dist/angular-permission-ui.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b5f8d15

Please sign in to comment.