code: function (value) {
                  var invalidRoles = _.difference(value, this.getRoles());
  
                  if (invalidRoles.length > 0) {
                      throw Error('Unable to restrict security roles to ' + angular.toJson(invalidRoles));
                  }
  
                  roleFilter = value;
  
                  if (config.persistentRestrictions) {
                      roleRestrictionsState.value(value);
                  }
  
                  /**
                   * @ngdoc event
                   * @name w20CoreSecurity.service:AuthorizationService#w20\.security\.role-filter-changed
                   * @eventOf w20CoreSecurity.service:AuthorizationService
                   * @eventType emitted on root scope
                   * @param {Array} the new list of roles of the user
                   *
                   * @description
                   *
                   * This event is emitted when user roles are filtered
                   */
                  eventService.emit('w20.security.role-filter-changed', value);
  
                  if (value.length === 0) {
                      $log.info('no security role restriction');
                  } else {
                      $log.info('security role(s) restricted to: ' + angular.toJson(value));
                  }
              }
docs: @ngdoc function
  @name w20CoreSecurity.service:AuthorizationService#setRoleFilter
  @methodOf w20CoreSecurity.service:AuthorizationService
  @param {Array} value a list of role to restrict to. If this list is not a subset of the list returned by
  getRoles() an error is thrown
  
  @description
  
  Allow to restrict user roles by setting a filter of roles