/** * Is the current user have right to show the current task ? * * @return boolean **/ function canViewItem() { if (!Session::haveAccessToEntity($this->getEntityID())) { return false; } $project = new Project(); if ($project->getFromDB($this->fields['projects_id'])) { return Session::haveRight(self::$rightname, Project::READALL) || Session::haveRight(self::$rightname, Project::READMY) && ($project->fields["users_id"] === Session::getLoginUserID() || $project->isInTheManagerGroup() || $project->isInTheTeam()) || Session::haveRight('projecttask', ProjectTask::READMY) && ($this->fields["users_id"] === Session::getLoginUserID() || $this->isInTheTeam()); } return false; }