code: function reversePromises (promises) {
      return promises.map(function (promise) {
        var d = $q.defer();
        promise.then(d.reject, d.resolve);
        return d.promise;
      });
    }
docs: 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>} Promise collection