Skip to content

Commit

Permalink
chore: Bump version to 4.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
masterspambot committed Oct 21, 2016
1 parent cb42f61 commit fbf3cf0
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 30 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": "4.1.0",
"version": "4.1.1",
"authors": [
"Rafael Vidaurre <narzerus@gmail.com> (http://www.rafaelvidaurre.com)",
"Blazej Krysiak <blazej.krysiak@gmail.com>"
Expand Down
8 changes: 6 additions & 2 deletions 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 v4.1.0 - 2016-10-19
* @version v4.1.1 - 2016-10-21
* @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 @@ -50,7 +50,11 @@
* @returns {boolean}
*/
function areSetRoutePermissions() {
return angular.isDefined(next.$$route.data) && angular.isDefined(next.$$route.data.permissions);
try {
return !!next.$$route.data.permissions;
} catch (e) {
return false;
}
}

/**
Expand Down
4 changes: 2 additions & 2 deletions dist/angular-permission-ng.min.js

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

2 changes: 1 addition & 1 deletion dist/angular-permission-ng.min.js.map

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

25 changes: 8 additions & 17 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 v4.1.0 - 2016-10-19
* @version v4.1.1 - 2016-10-21
* @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 @@ -201,7 +201,7 @@
* @returns {boolean}
*/
function areEventsDefaultPrevented() {
return isStateChangePermissionStartDefaultPrevented() || isStateChangeStartDefaultPrevented();
return isStateChangePermissionStartDefaultPrevented();
}

/**
Expand Down Expand Up @@ -257,20 +257,6 @@
PermTransitionProperties.options).defaultPrevented;
}

/**
* Checks if event $stateChangeStart hasn't been disabled by default
* @methodOf permission.ui.PermTransitionEvents
* @private
*
* @returns {boolean}
*/
function isStateChangeStartDefaultPrevented() {
return $rootScope.$broadcast('$stateChangeStart',
PermTransitionProperties.toState, PermTransitionProperties.toParams,
PermTransitionProperties.fromState, PermTransitionProperties.fromParams,
PermTransitionProperties.options).defaultPrevented;
}

return $delegate;
}

Expand Down Expand Up @@ -483,13 +469,18 @@

/**
* Checks if state has set permissions
* We check for hasOwnProperty, because ui-router lets the `data` property inherit from its parent
* @methodOf permission.ui.StatePermissionMap
* @private
*
* @returns {boolean}
*/
function areSetStatePermissions(state) {
return angular.isDefined(state.data) && angular.isDefined(state.data.permissions);
try {
return Object.prototype.hasOwnProperty.call(state.data, 'permissions');
} catch (e) {
return false;
}
}

return StatePermissionMap;
Expand Down
Loading

0 comments on commit fbf3cf0

Please sign in to comment.