Skip to content

Migration guide 2.3.x to 3.0.x

pws019 edited this page Jul 26, 2016 · 5 revisions

Below is written down minimal set of action that has be taken to migrate from 2.3.x version:

Dependencies

From now integration with ui-router is moved into separate module permission.ui, so at first you need to update your module dependencies by adding it to array of dependencies.

angular.module('app', [
 ...
 'ui.router', ('ct.ui.router.extras.core',) 
 'permission', 'permission.ui', 
 ...
]);

RoleStore

Signature of method defineRole has been unified to improve amount of passed arguments. So there is no need to add empty array as parameter if you have custom validation function.

[...]

RoleStore
  .defineRole('ROLE_NAME', ['permissionNameA', 'permissionNameB', 'permissionNameC', ...])
  
RoleStore
  .defineRole('ROLE_NAME', function (roleName, transitionProperties) {
        [...]
      });
  });

Additionally the method defineManyRoles has been added, see the documentation if it fits your project business needs..