openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

ProjectHistoryAction.class.php (706B)


      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 }