Example #1
0
 /**
  * Check whether the user can access the specified project page
  *
  * @param string $page The page key
  * @param Project $project
  *
  * @return boolean
  */
 public function hasProjectPageAccess($page, Project $project)
 {
     $retval = $this->hasPageAccess($page, $project->getID());
     $retval = $retval === null ? $this->hasPageAccess('project_allpages', $project->getID()) : $retval;
     if ($retval === null) {
         if ($project->getOwner() instanceof User && $project->getOwner()->getID() == $this->getID()) {
             return true;
         }
         if ($project->getLeader() instanceof User && $project->getLeader()->getID() == $this->getID()) {
             return true;
         }
     }
     return $retval !== null ? $retval : framework\Settings::isPermissive();
 }