FolderAddAction.class.php (1123B)
1 <?php 2 namespace cms\action\folder; 3 use cms\action\FolderAction; 4 use cms\action\Method; 5 use cms\model\Permission; 6 use util\exception\SecurityException; 7 8 9 class FolderAddAction extends FolderAction implements Method { 10 11 public function view() { 12 $this->setTemplateVar('mayCreateFolder',$this->folder->hasRight( Permission::ACL_CREATE_FOLDER ) ); 13 $this->setTemplateVar('mayCreateFile' ,$this->folder->hasRight( Permission::ACL_CREATE_FILE ) ); 14 $this->setTemplateVar('mayCreateText' ,$this->folder->hasRight( Permission::ACL_CREATE_FILE ) ); 15 $this->setTemplateVar('mayCreateImage' ,$this->folder->hasRight( Permission::ACL_CREATE_FILE ) ); 16 $this->setTemplateVar('mayCreatePage' ,$this->folder->hasRight( Permission::ACL_CREATE_PAGE ) ); 17 $this->setTemplateVar('mayCreateUrl' ,$this->folder->hasRight( Permission::ACL_CREATE_LINK ) ); 18 $this->setTemplateVar('mayCreateLink' ,$this->folder->hasRight( Permission::ACL_CREATE_LINK ) ); 19 20 } 21 22 public function post() { 23 } 24 25 26 public function checkAccess() 27 { 28 if ( ! parent::hasPermissionToAddAnyObject() ) 29 throw new SecurityException(); 30 } 31 }