File modules/cms/action/project/ProjectHistoryAction.class.php

Last commit: Sun Mar 14 22:29:56 2021 +0100	Jan Dankert	Refactoring: Clearer access check.
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\BaseObject; 7 use cms\model\Permission; 8 9 class ProjectHistoryAction extends ProjectAction implements Method { 10 11 public function view() { 12 $result = $this->project->getLastChanges(); 13 14 // Permission check 15 $result = array_filter( $result, function( $object ) { 16 $baseObject = new BaseObject($object['objectid']); 17 return $baseObject->hasRight( Permission::ACL_READ ); 18 }); 19 20 $this->setTemplateVar('timeline', $result); 21 } 22 23 public function post() { 24 } 25 26 public function checkAccess() { 27 return true; // rights for every search result are respected in view() 28 } 29 30 }
Download modules/cms/action/project/ProjectHistoryAction.class.php
History 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. Tue, 17 Nov 2020 23:51:00 +0100 Jan Dankert Refactoring: Every Actionmethod has now its own class.