From b5f8d15267657b6c54d9bbe9f49437f3bf3f542b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Krysiak?= Date: Sat, 20 Jan 2018 11:22:20 +0100 Subject: [PATCH] chore: Bump version to 6.0.0 --- bower.json | 2 +- dist/angular-permission-ng.js | 2 +- dist/angular-permission-ng.min.js | 2 +- dist/angular-permission-ui.js | 35 ++++++++++++++++++++++----- dist/angular-permission-ui.min.js | 4 +-- dist/angular-permission-ui.min.js.map | 2 +- dist/angular-permission.js | 2 +- dist/angular-permission.min.js | 2 +- index.js | 2 +- package.json | 2 +- 10 files changed, 39 insertions(+), 16 deletions(-) diff --git a/bower.json b/bower.json index 51b7769..04ba2d8 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "angular-permission", - "version": "5.3.2", + "version": "6.0.0", "authors": [ "Rafael Vidaurre (http://www.rafaelvidaurre.com)", "Blazej Krysiak " diff --git a/dist/angular-permission-ng.js b/dist/angular-permission-ng.js index 174c22c..d425478 100644 --- a/dist/angular-permission-ng.js +++ b/dist/angular-permission-ng.js @@ -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 (http://www.rafaelvidaurre.com), Blazej Krysiak * @license MIT License, http://www.opensource.org/licenses/MIT diff --git a/dist/angular-permission-ng.min.js b/dist/angular-permission-ng.min.js index 6b42450..fa4e212 100644 --- a/dist/angular-permission-ng.min.js +++ b/dist/angular-permission-ng.min.js @@ -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 (http://www.rafaelvidaurre.com), Blazej Krysiak * @license MIT License, http://www.opensource.org/licenses/MIT diff --git a/dist/angular-permission-ui.js b/dist/angular-permission-ui.js index 0dd1606..dfec0fb 100644 --- a/dist/angular-permission-ui.js +++ b/dist/angular-permission-ui.js @@ -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 (http://www.rafaelvidaurre.com), Blazej Krysiak * @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 collection + */ + function reversePromises(promises) { + return promises.map(function (promise) { + var d = $q.defer(); + promise.then(d.reject, d.resolve); + return d.promise; + }); + } } angular diff --git a/dist/angular-permission-ui.min.js b/dist/angular-permission-ui.min.js index 0d9f4aa..f3ca7e6 100644 --- a/dist/angular-permission-ui.min.js +++ b/dist/angular-permission-ui.min.js @@ -1,12 +1,12 @@ /** * 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 (http://www.rafaelvidaurre.com), Blazej Krysiak * @license MIT License, http://www.opensource.org/licenses/MIT */ -!function(a,angular,b){"use strict";function c(a){"ngInject";a.decorator("$delegate",function(a){return a.self.$$permissionState=function(){return a},a})}function d(a,b,c,d,e,f,g){"ngInject";function h(a){function b(a){d.toState=a.to(),d.toParams=a.params("to"),d.fromState=a.from(),d.fromParams=a.params("from"),d.options=a.options()}b(a);var c=new g(d.toState);return f.authorizeByPermissionMap(c).catch(function(b){return c.resolveRedirectState(b).then(function(b){return a.router.stateService.target(b.state,b.params,b.options)})})}function i(a,b,h,i,j,k){function l(){d.toState=b,d.toParams=h,d.fromState=i,d.fromParams=j,d.options=k}function m(a){angular.extend(b,{$$isAuthorizationFinished:a})}function n(){return b.$$isAuthorizationFinished}function o(){e.broadcastPermissionAcceptedEvent();var a=angular.extend({},d.options,{notify:!1,location:!0});c.go(d.toState.name,d.toParams,a).then(function(){e.broadcastStateChangeSuccessEvent()})}function p(a,b){e.broadcastPermissionDeniedEvent(),b.resolveRedirectState(a).then(function(a){c.go(a.state,a.params,a.options)})}if(!n())if(m(!0),l(),e.areEventsDefaultPrevented())m(!1);else{e.broadcastPermissionStartEvent(),a.preventDefault();var q=new g(d.toState);f.authorizeByPermissionMap(q).then(function(){o()}).catch(function(a){p(a,q)}).finally(function(){m(!1)})}}if(a.has("$transitions")){var j=a.get("$transitions");j.onBefore({},h)}else b.$on("$stateChangeStart",function(a,b,c,d,e,f){i(a,b,c,d,e,f)})}function e(a,b,c,d){"ngInject";function e(){return j()||k()}function f(){b.$broadcast(d.permissionStart,c.toState,c.toParams,c.options)}function g(){b.$broadcast(d.permissionAccepted,c.toState,c.toParams,c.options)}function h(){b.$broadcast(d.permissionDenies,c.toState,c.toParams,c.options)}function i(){b.$broadcast("$stateChangeSuccess",c.toState,c.toParams,c.fromState,c.fromParams)}function j(){return b.$broadcast(d.permissionStart,c.toState,c.toParams,c.options).defaultPrevented}function k(){return b.$broadcast("$stateChangeStart",c.toState,c.toParams,c.fromState,c.fromParams,c.options).defaultPrevented}return a.areEventsDefaultPrevented=e,a.broadcastStateChangeSuccessEvent=i,a.broadcastPermissionStartEvent=f,a.broadcastPermissionAcceptedEvent=g,a.broadcastPermissionDeniedEvent=h,a}function f(a,b,c){"ngInject";function d(a){return f(a)}function e(a){var e=b.get(a),f=new c(e);return d(f)}function f(b){var c=a.defer();return g(c,b),c.promise}function g(b,c){var d=i(c.except,c);a.all(d).then(function(a){b.reject(a[0])}).catch(function(){h(b,c)})}function h(b,c){if(!c.only.length)return void b.resolve();var d=i(c.only,c);a.all(d).then(function(a){b.resolve(a)}).catch(function(a){b.reject(a)})}function i(b,c){return b.length?b.map(function(b){var d=c.resolvePropertyValidity(b);return a.any(d).then(function(a){return angular.isArray(a)?a[0]:a})}):[a.reject()]}this.authorizeByPermissionMap=d,this.authorizeByStateName=e}function g(a){"ngInject";function b(b){var d=b.$$permissionState(),e=d.path;angular.forEach(e,function(b){if(c(b)){var d=new a(b.data.permissions);this.extendPermissionMap(d)}},this)}function c(a){try{return Object.prototype.hasOwnProperty.call(a.data,"permissions")}catch(a){return!1}}return b.prototype=new a,b.prototype.extendPermissionMap=function(a){a.only.length&&(this.only=this.only.concat([a.only])),a.except.length&&(this.except=this.except.concat([a.except])),angular.isDefined(a.redirectTo)&&(this.redirectTo=angular.extend({},this.redirectTo,a.redirectTo))},b}c.$inject=["$stateProvider"],d.$inject=["$injector","$rootScope","$state","PermTransitionProperties","PermTransitionEvents","PermStateAuthorization","PermStatePermissionMap"],e.$inject=["$delegate","$rootScope","PermTransitionProperties","PermTransitionEventNames"],f.$inject=["$q","$state","PermStatePermissionMap"],g.$inject=["PermPermissionMap"];var h=angular.module("permission.ui",["permission","ui.router"]).config(c).run(d);"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports=h.name),angular.module("permission.ui").decorator("PermTransitionEvents",e);var i={permissionStart:"$stateChangePermissionStart",permissionAccepted:"$stateChangePermissionAccepted",permissionDenies:"$stateChangePermissionDenied"};angular.module("permission.ui").value("PermTransitionEventNames",i),angular.module("permission").service("PermStateAuthorization",f),angular.module("permission.ui").factory("PermStatePermissionMap",g)}(window,window.angular); +!function(a,angular,b){"use strict";function c(a){"ngInject";a.decorator("$delegate",function(a){return a.self.$$permissionState=function(){return a},a})}function d(a,b,c,d,e,f,g){"ngInject";function h(a){function b(a){d.toState=a.to(),d.toParams=a.params("to"),d.fromState=a.from(),d.fromParams=a.params("from"),d.options=a.options()}b(a);var c=new g(d.toState);return f.authorizeByPermissionMap(c).catch(function(b){return c.resolveRedirectState(b).then(function(b){return a.router.stateService.target(b.state,b.params,b.options)})})}function i(a,b,h,i,j,k){function l(){d.toState=b,d.toParams=h,d.fromState=i,d.fromParams=j,d.options=k}function m(a){angular.extend(b,{$$isAuthorizationFinished:a})}function n(){return b.$$isAuthorizationFinished}function o(){e.broadcastPermissionAcceptedEvent();var a=angular.extend({},d.options,{notify:!1,location:!0});c.go(d.toState.name,d.toParams,a).then(function(){e.broadcastStateChangeSuccessEvent()})}function p(a,b){e.broadcastPermissionDeniedEvent(),b.resolveRedirectState(a).then(function(a){c.go(a.state,a.params,a.options)})}if(!n())if(m(!0),l(),e.areEventsDefaultPrevented())m(!1);else{e.broadcastPermissionStartEvent(),a.preventDefault();var q=new g(d.toState);f.authorizeByPermissionMap(q).then(function(){o()}).catch(function(a){p(a,q)}).finally(function(){m(!1)})}}if(a.has("$transitions")){var j=a.get("$transitions");j.onBefore({},h)}else b.$on("$stateChangeStart",function(a,b,c,d,e,f){i(a,b,c,d,e,f)})}function e(a,b,c,d){"ngInject";function e(){return j()||k()}function f(){b.$broadcast(d.permissionStart,c.toState,c.toParams,c.options)}function g(){b.$broadcast(d.permissionAccepted,c.toState,c.toParams,c.options)}function h(){b.$broadcast(d.permissionDenies,c.toState,c.toParams,c.options)}function i(){b.$broadcast("$stateChangeSuccess",c.toState,c.toParams,c.fromState,c.fromParams)}function j(){return b.$broadcast(d.permissionStart,c.toState,c.toParams,c.options).defaultPrevented}function k(){return b.$broadcast("$stateChangeStart",c.toState,c.toParams,c.fromState,c.fromParams,c.options).defaultPrevented}return a.areEventsDefaultPrevented=e,a.broadcastStateChangeSuccessEvent=i,a.broadcastPermissionStartEvent=f,a.broadcastPermissionAcceptedEvent=g,a.broadcastPermissionDeniedEvent=h,a}function f(a,b,c){"ngInject";function d(a){return f(a)}function e(a){var e=b.get(a),f=new c(e);return d(f)}function f(b){var c=a.defer();return g(c,b),c.promise}function g(b,c){var d=i(c.except,c);a.all(j(d)).then(function(){h(b,c)}).catch(function(a){angular.isArray(a)||(a=[a]),b.reject(a[0])})}function h(b,c){if(!c.only.length)return void b.resolve();var d=i(c.only,c);a.all(d).then(function(a){b.resolve(a)}).catch(function(a){b.reject(a)})}function i(b,c){return b.length?b.map(function(b){var d=c.resolvePropertyValidity(b);return a.any(d).then(function(a){return angular.isArray(a)?a[0]:a})}):[a.reject()]}function j(b){return b.map(function(b){var c=a.defer();return b.then(c.reject,c.resolve),c.promise})}this.authorizeByPermissionMap=d,this.authorizeByStateName=e}function g(a){"ngInject";function b(b){var d=b.$$permissionState(),e=d.path;angular.forEach(e,function(b){if(c(b)){var d=new a(b.data.permissions);this.extendPermissionMap(d)}},this)}function c(a){try{return Object.prototype.hasOwnProperty.call(a.data,"permissions")}catch(a){return!1}}return b.prototype=new a,b.prototype.extendPermissionMap=function(a){a.only.length&&(this.only=this.only.concat([a.only])),a.except.length&&(this.except=this.except.concat([a.except])),angular.isDefined(a.redirectTo)&&(this.redirectTo=angular.extend({},this.redirectTo,a.redirectTo))},b}c.$inject=["$stateProvider"],d.$inject=["$injector","$rootScope","$state","PermTransitionProperties","PermTransitionEvents","PermStateAuthorization","PermStatePermissionMap"],e.$inject=["$delegate","$rootScope","PermTransitionProperties","PermTransitionEventNames"],f.$inject=["$q","$state","PermStatePermissionMap"],g.$inject=["PermPermissionMap"];var h=angular.module("permission.ui",["permission","ui.router"]).config(c).run(d);"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports=h.name),angular.module("permission.ui").decorator("PermTransitionEvents",e);var i={permissionStart:"$stateChangePermissionStart",permissionAccepted:"$stateChangePermissionAccepted",permissionDenies:"$stateChangePermissionDenied"};angular.module("permission.ui").value("PermTransitionEventNames",i),angular.module("permission").service("PermStateAuthorization",f),angular.module("permission.ui").factory("PermStatePermissionMap",g)}(window,window.angular); //# sourceMappingURL=angular-permission-ui.min.js.map \ No newline at end of file diff --git a/dist/angular-permission-ui.min.js.map b/dist/angular-permission-ui.min.js.map index be90499..c5ede4e 100644 --- a/dist/angular-permission-ui.min.js.map +++ b/dist/angular-permission-ui.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["angular-permission-ui.js"],"names":["window","angular","undefined","config","$stateProvider","decorator","$delegate","self","$$permissionState","run","$injector","$rootScope","$state","PermTransitionProperties","PermTransitionEvents","PermStateAuthorization","PermStatePermissionMap","handleOnBeforeWebHook","transition","setTransitionProperties","toState","to","toParams","params","fromState","from","fromParams","options","statePermissionMap","authorizeByPermissionMap","catch","rejectedPermission","resolveRedirectState","then","redirect","router","stateService","target","state","handleStateChangeStartEvent","event","setStateAuthorizationStatus","status","extend","$$isAuthorizationFinished","isAuthorizationFinished","handleAuthorizedState","broadcastPermissionAcceptedEvent","transitionOptions","notify","location","go","name","broadcastStateChangeSuccessEvent","handleUnauthorizedState","broadcastPermissionDeniedEvent","areEventsDefaultPrevented","broadcastPermissionStartEvent","preventDefault","finally","has","$transitions","get","onBefore","$on","PermTransitionEventNames","isStateChangePermissionStartDefaultPrevented","isStateChangeStartDefaultPrevented","$broadcast","permissionStart","permissionAccepted","permissionDenies","defaultPrevented","$q","authorizeStatePermissionMap","authorizeByStateName","stateName","srefState","permissionMap","map","deferred","defer","resolveExceptStatePermissionMap","promise","exceptPromises","resolveStatePermissionMap","except","all","rejectedPermissions","reject","resolveOnlyStatePermissionMap","only","length","resolve","onlyPromises","resolvedPermissions","privilegesNames","statePrivileges","resolvedStatePrivileges","resolvePropertyValidity","any","isArray","this","PermPermissionMap","StatePermissionMap","toStateObject","toStatePath","path","forEach","areSetStatePermissions","data","permissions","extendPermissionMap","Object","prototype","hasOwnProperty","call","e","concat","isDefined","redirectTo","$inject","uiPermission","module","exports","value","service","factory"],"mappings":";;;;;;;;;;CASC,SAAUA,EAAQC,QAASC,GAC1B,YAeA,SAASC,GAAOC,GACd,UAEAA,GAAeC,UAAU,YAAa,SAAUC,GAc9C,MAJAA,GAAUC,KAAKC,kBAAoB,WACjC,MAAOF,IAGFA,IAaX,QAASG,GAAIC,EAAWC,EAAYC,EAAQC,EAA0BC,EAAsBC,EAAwBC,GAClH,UAiBA,SAASC,GAAsBC,GAmB7B,QAASC,GAAwBD,GAC/BL,EAAyBO,QAAUF,EAAWG,KAC9CR,EAAyBS,SAAWJ,EAAWK,OAAO,MACtDV,EAAyBW,UAAYN,EAAWO,OAChDZ,EAAyBa,WAAaR,EAAWK,OAAO,QACxDV,EAAyBc,QAAUT,EAAWS,UAvBhDR,EAAwBD,EACxB,IAAIU,GAAqB,GAAIZ,GAAuBH,EAAyBO,QAE7E,OAAOL,GACJc,yBAAyBD,GACzBE,MAAM,SAAUC,GACf,MAAOH,GACJI,qBAAqBD,GACrBE,KAAK,SAAUC,GACd,MAAOhB,GAAWiB,OAAOC,aAAaC,OAAOH,EAASI,MAAOJ,EAASX,OAAQW,EAASP,aAqBjG,QAASY,GAA4BC,EAAOpB,EAASE,EAAUE,EAAWE,EAAYC,GAiCpF,QAASR,KACPN,EAAyBO,QAAUA,EACnCP,EAAyBS,SAAWA,EACpCT,EAAyBW,UAAYA,EACrCX,EAAyBa,WAAaA,EACtCb,EAAyBc,QAAUA,EAUrC,QAASc,GAA4BC,GACnCzC,QAAQ0C,OAAOvB,GACbwB,0BAA6BF,IAWjC,QAASG,KACP,MAAOzB,GAAQwB,0BAQjB,QAASE,KACPhC,EAAqBiC,kCAGrB,IAAIC,GAAoB/C,QAAQ0C,UAAW9B,EAAyBc,SAClEsB,QAAQ,EACRC,UAAU,GAGZtC,GACGuC,GAAGtC,EAAyBO,QAAQgC,KAAMvC,EAAyBS,SAAU0B,GAC7Ef,KAAK,WACJnB,EAAqBuC,qC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,uBAAwBS,EAYrC,IAAImD,IACFI,gBAAiB,8BACjBC,mBAAoB,iCACpBC,iBAAkB,+BAGpBtE,SACG0H,OAAO,iBACPE,MAAM,2BAA4B5D,GAsIrChE,QACG0H,OAAO,cACPG,QAAQ,yBAA0B/G,GAwErCd,QACG0H,OAAO,iBACPI,QAAQ,yBAA0B/G,IAErChB,OAAQA,OAAOC","file":"angular-permission-ui.min.js"} \ No newline at end of file +{"version":3,"sources":["angular-permission-ui.js"],"names":["window","angular","undefined","config","$stateProvider","decorator","$delegate","self","$$permissionState","run","$injector","$rootScope","$state","PermTransitionProperties","PermTransitionEvents","PermStateAuthorization","PermStatePermissionMap","handleOnBeforeWebHook","transition","setTransitionProperties","toState","to","toParams","params","fromState","from","fromParams","options","statePermissionMap","authorizeByPermissionMap","catch","rejectedPermission","resolveRedirectState","then","redirect","router","stateService","target","state","handleStateChangeStartEvent","event","setStateAuthorizationStatus","status","extend","$$isAuthorizationFinished","isAuthorizationFinished","handleAuthorizedState","broadcastPermissionAcceptedEvent","transitionOptions","notify","location","go","name","broadcastStateChangeSuccessEvent","handleUnauthorizedState","broadcastPermissionDeniedEvent","areEventsDefaultPrevented","broadcastPermissionStartEvent","preventDefault","finally","has","$transitions","get","onBefore","$on","PermTransitionEventNames","isStateChangePermissionStartDefaultPrevented","isStateChangeStartDefaultPrevented","$broadcast","permissionStart","permissionAccepted","permissionDenies","defaultPrevented","$q","authorizeStatePermissionMap","authorizeByStateName","stateName","srefState","permissionMap","map","deferred","defer","resolveExceptStatePermissionMap","promise","exceptPromises","resolveStatePermissionMap","except","all","reversePromises","resolveOnlyStatePermissionMap","rejectedPermissions","isArray","reject","only","length","resolve","onlyPromises","resolvedPermissions","privilegesNames","statePrivileges","resolvedStatePrivileges","resolvePropertyValidity","any","promises","d","this","PermPermissionMap","StatePermissionMap","toStateObject","toStatePath","path","forEach","areSetStatePermissions","data","permissions","extendPermissionMap","Object","prototype","hasOwnProperty","call","e","concat","isDefined","redirectTo","$inject","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LlC,IAAIC,GAAe5H,QAChB6H,OAAO,iBAAkB,aAAc,cACvC3H,OAAOA,GACPM,IAAIA,EAEe,oBAAXqH,SAA6C,mBAAZC,UAA2BD,OAAOC,UAAYA,UACxFD,OAAOC,QAAUF,EAAazE,MAwGhCnD,QACG6H,OAAO,iBACPzH,UAAU,uBAAwBS,EAYrC,IAAImD,IACFI,gBAAiB,8BACjBC,mBAAoB,iCACpBC,iBAAkB,+BAGpBtE,SACG6H,OAAO,iBACPE,MAAM,2BAA4B/D,GA6JrChE,QACG6H,OAAO,cACPG,QAAQ,yBAA0BlH,GAwErCd,QACG6H,OAAO,iBACPI,QAAQ,yBAA0BlH,IAErChB,OAAQA,OAAOC","file":"angular-permission-ui.min.js"} \ No newline at end of file diff --git a/dist/angular-permission.js b/dist/angular-permission.js index 14f59a5..a56d36f 100644 --- a/dist/angular-permission.js +++ b/dist/angular-permission.js @@ -1,7 +1,7 @@ /** * angular-permission * Fully featured role and permission based access control for your angular applications - * @version v5.3.2 - 2017-05-29 + * @version v6.0.0 - 2018-01-20 * @link https://github.com/Narzerus/angular-permission * @author Rafael Vidaurre (http://www.rafaelvidaurre.com), Blazej Krysiak * @license MIT License, http://www.opensource.org/licenses/MIT diff --git a/dist/angular-permission.min.js b/dist/angular-permission.min.js index 810bfd1..c07e014 100644 --- a/dist/angular-permission.min.js +++ b/dist/angular-permission.min.js @@ -1,7 +1,7 @@ /** * angular-permission * Fully featured role and permission based access control for your angular applications - * @version v5.3.2 - 2017-05-29 + * @version v6.0.0 - 2018-01-20 * @link https://github.com/Narzerus/angular-permission * @author Rafael Vidaurre (http://www.rafaelvidaurre.com), Blazej Krysiak * @license MIT License, http://www.opensource.org/licenses/MIT diff --git a/index.js b/index.js index ba56afd..c1507a6 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,7 @@ /** * angular-permission * Fully featured role and permission based access control for your angular applications - * @version v5.3.2 - 2017-05-29 + * @version v6.0.0 - 2018-01-20 * @link https://github.com/Narzerus/angular-permission * @author Rafael Vidaurre (http://www.rafaelvidaurre.com), Blazej Krysiak * @license MIT License, http://www.opensource.org/licenses/MIT diff --git a/package.json b/package.json index b1101b4..0aa5734 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-permission", - "version": "5.3.2", + "version": "6.0.0", "description": "Fully featured role and permission based access control for your angular applications", "author": { "name": "Rafael Vidaurre",