code: function resolveRedirectState(redirectFunction, rejectedPermissionName) {
      return $q
        .when($injector.invoke(redirectFunction, null, {
          rejectedPermission: rejectedPermissionName,
          transitionProperties: PermTransitionProperties
        }))
        .then(function (redirectState) {
          if (angular.isString(redirectState)) {
            return {
              state: redirectState
            };
          }
  
          if (angular.isObject(redirectState)) {
            return redirectState;
          }
  
          return $q.reject();
        });
    }
docs: Handles function based redirection for rejected permissions
  @methodOf permission.PermissionMap
  
  @throws {TypeError}
  
  @param redirectFunction {Function} Redirection function
  @param rejectedPermissionName {String} Rejected permission
  
  @return {Promise}