/** * Retrieve an array of Ansel_Gallery objects for the requested ids * * @param array $ids Gallery ids to fetch * @param integer $perms Horde_Perms constant for the perms required. * * @return array An array of Ansel_Gallery objects * @throws Ansel_Exception */ public function getGalleries(array $ids, $perms = Horde_Perms::SHOW) { try { $shares = $this->buildGalleries($this->_shares->getShares($ids)); } catch (Horde_Share_Exception $e) { throw new Ansel_Exception($e); } catch (Horde_Exception_NotFound $e) { throw new Ansel_Exception($e); } $galleries = array(); foreach ($shares as $gallery) { if ($gallery->hasPermission($GLOBALS['registry']->getAuth(), $perms)) { $galleries[] = $gallery; } } return $galleries; }