public function setTags(array $tags, $replace = true)
{
if ($this->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
if ($replace) {
$GLOBALS['injector']->getInstance('Ansel_Tagger')->replaceTags($this->id, $tags, $this->get('owner'), 'gallery');
} else {
$GLOBALS['injector']->getInstance('Ansel_Tagger')->tag($this->id, $tags, $this->get('owner'), 'gallery');
}
} else {
throw new Horde_Exception_PermissionDenied(_("Access denied adding tags to this gallery."));
}
}