File modules/cms/action/project/ProjectEditAction.class.php
Last commit: Fri Dec 3 22:14:36 2021 +0100 dankert Fix: Check rights for adding a project.
1 <?php 2 namespace cms\action\project; 3 use cms\action\Action; 4 use cms\action\Method; 5 use cms\action\ProjectAction; 6 use cms\model\Folder; 7 use cms\model\Permission; 8 use util\exception\SecurityException; 9 10 class ProjectEditAction extends ProjectAction implements Method { 11 12 public function view() { 13 14 $this->setTemplateVar('name' ,$this->project->name); 15 $this->setTemplateVar('projectid' ,$this->project->projectid); 16 $this->setTemplateVar('rootobjectid' ,$this->project->getRootObjectId()); 17 $this->setTemplateVar('is_project_admin',$this->userIsProjectAdmin()); 18 } 19 public function post() { 20 } 21 22 23 24 /** 25 * the root object must be readable by the current user. 26 */ 27 public function checkAccess() { 28 $rootFolderId = $this->project->getRootObjectId(); 29 30 $rootFolder = new Folder( $rootFolderId ); 31 $rootFolder->load(); 32 33 if ( ! $rootFolder->hasRight( Permission::ACL_READ ) ) 34 throw new SecurityException(); 35 } 36 37 }
Downloadmodules/cms/action/project/ProjectEditAction.class.php
History Fri, 3 Dec 2021 22:14:36 +0100 dankert Fix: Check rights for adding a project. Sun, 14 Mar 2021 22:29:56 +0100 Jan Dankert Refactoring: Clearer access check. Sat, 6 Mar 2021 03:42:38 +0100 Jan Dankert New: Better permission checks. Sat, 20 Feb 2021 01:34:41 +0100 Jan Dankert New: Publish-switch for templates. Tue, 17 Nov 2020 23:51:00 +0100 Jan Dankert Refactoring: Every Actionmethod has now its own class.