File modules/cms/action/projectlist/ProjectlistHistoryAction.class.php
Last commit: Fri Dec 3 22:30:29 2021 +0100 dankert Fix: Check rights for listing projects.
1 <?php 2 namespace cms\action\projectlist; 3 use cms\action\Action; 4 use cms\action\Method; 5 use cms\action\ProjectlistAction; 6 use cms\model\BaseObject; 7 use cms\model\Permission; 8 use cms\model\Project; 9 10 class ProjectlistHistoryAction extends ProjectlistAction implements Method { 11 12 13 /** 14 * History of a project. 15 */ 16 public function view() { 17 18 $result = Project::getAllLastChanges(); 19 20 // Permission check 21 $result = array_filter( $result, function( $object ) { 22 $baseObject = new BaseObject($object['objectid']); 23 return $baseObject->hasRight( Permission::ACL_READ ); 24 }); 25 26 $this->setTemplateVar('timeline', $result); 27 } 28 29 30 public function post() { 31 throw new \BadMethodCallException(); 32 } 33 34 35 /** 36 * Check permission. This is allowed to all users. 37 * @return bool true 38 */ 39 function checkAccess() 40 { 41 return true; 42 } 43 }
Downloadmodules/cms/action/projectlist/ProjectlistHistoryAction.class.php
History Fri, 3 Dec 2021 22:30:29 +0100 dankert Fix: Check rights for listing projects. 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.