Skip to content

Commit

Permalink
chore: Bump version to 5.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
masterspambot committed Mar 15, 2017
1 parent 288522a commit ac11eec
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 14 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.2.1",
"version": "5.2.2",
"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.1.1 - 2017-01-31
* @version v5.2.2 - 2017-03-15
* @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.

2 changes: 1 addition & 1 deletion 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.1.1 - 2017-01-31
* @version v5.2.2 - 2017-03-15
* @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-ui.min.js

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

55 changes: 51 additions & 4 deletions dist/angular-permission.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* angular-permission
* Fully featured role and permission based access control for your angular applications
* @version v5.1.1 - 2017-01-31
* @version v5.2.2 - 2017-03-15
* @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 All @@ -24,10 +24,55 @@
PermPermissionMap.$inject = ['$q', '$log', '$injector', 'PermTransitionProperties', 'PermRoleStore', 'PermPermissionStore'];
var permission = angular.module('permission', []);

/* istanbul ignore if */
if (typeof module !== 'undefined' && typeof exports !== 'undefined' && module.exports === exports) {
module.exports = permission.name;
}

/**
* Permission module configuration provider
*
* @name permission.permissionProvider
*/
function $permission() {
'ngInject';

var defaultOnAuthorizedMethod = 'showElement';
var defaultOnUnauthorizedMethod = 'hideElement';

/**
* Methods allowing to alter default directive onAuthorized behaviour in permission directive
* @methodOf permission.permissionProvider
*
* @param onAuthorizedMethod {String} One of permission.PermPermissionStrategies method names
*/
this.setDefaultOnAuthorizedMethod = function (onAuthorizedMethod) { // jshint ignore:line
defaultOnAuthorizedMethod = onAuthorizedMethod;
};

/**
* Methods allowing to alter default directive onUnauthorized behaviour in permission directive
* @methodOf permission.permissionProvider
*
* @param onUnauthorizedMethod {String} One of permission.PermPermissionStrategies method names
*/
this.setDefaultOnUnauthorizedMethod = function (onUnauthorizedMethod) { // jshint ignore:line
defaultOnUnauthorizedMethod = onUnauthorizedMethod;
};


this.$get = function () { // jshint ignore:line
return {
defaultOnAuthorizedMethod: defaultOnAuthorizedMethod,
defaultOnUnauthorizedMethod: defaultOnUnauthorizedMethod
};
};
}

angular
.module('permission')
.provider('$permission', $permission);

/**
* Extends $q implementation by A+ *any* method
* @name permission.$q
Expand Down Expand Up @@ -702,7 +747,7 @@
onUnauthorized: '&?permissionOnUnauthorized'
},
controllerAs: 'permission',
controller: ['$scope', '$element', function ($scope, $element) {
controller: ['$scope', '$element', '$permission', function ($scope, $element, $permission) {
var permission = this;

$scope.$watchGroup(['permission.only', 'permission.except', 'sref'],
Expand Down Expand Up @@ -759,7 +804,8 @@
if (angular.isFunction(permission.onAuthorized)) {
permission.onAuthorized()($element);
} else {
PermPermissionStrategies.showElement($element);
var onAuthorizedMethodName = $permission.defaultOnAuthorizedMethod;
PermPermissionStrategies[onAuthorizedMethodName]($element);
}
}

Expand All @@ -771,7 +817,8 @@
if (angular.isFunction(permission.onUnauthorized)) {
permission.onUnauthorized()($element);
} else {
PermPermissionStrategies.hideElement($element);
var onUnauthorizedMethodName = $permission.defaultOnUnauthorizedMethod;
PermPermissionStrategies[onUnauthorizedMethodName]($element);
}
}
}]
Expand Down
4 changes: 2 additions & 2 deletions dist/angular-permission.min.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* angular-permission
* Fully featured role and permission based access control for your angular applications
* @version v5.1.1 - 2017-01-31
* @version v5.2.2 - 2017-03-15
* @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 package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-permission",
"version": "5.2.1",
"version": "5.2.2",
"description": "Fully featured role and permission based access control for your angular applications",
"author": {
"name": "Rafael Vidaurre",
Expand Down

0 comments on commit ac11eec

Please sign in to comment.