Exemplo n.º 1
0
 public function checkPerm()
 {
     $db = ezcDbInstance::get();
     $act = $this->act == 'list' ? 'SHOW' : strToUpper($this->act);
     $name = strToUpper($this->baseName);
     if (!$this->auth->hasPerm($act, $name)) {
         die(sprintf(_("PERMISSION DENIED [%s/%s]"), $act, $name));
     }
     if ($this->act == 'open') {
         // Download
         R3Security::checkDocumentByFileId($this->file_id);
     } else {
         // Attribute
         R3Security::checkDocumentForObject($this->act, $this->doc_object_id, $this->id, array('kind' => $this->type));
     }
 }