예제 #1
0
 /**
  * Check that tracker can be accessed by user
  *
  * @param Tracker         $tracker
  * @param User            $user
  * @param Codendi_Request $request
  *
  * @throws Tracker_CannotAccessTrackerException
  */
 public function checkUserCanAccessTracker($tracker, $user, Codendi_Request $request)
 {
     $this->checkServiceEnabled($tracker->getProject(), $request);
     if (!$tracker->isActive()) {
         throw new Tracker_CannotAccessTrackerException($GLOBALS['Language']->getText('plugin_tracker_common_type', 'tracker_not_exist'));
     }
     if (!$tracker->userCanView($user)) {
         throw new Tracker_CannotAccessTrackerException($GLOBALS['Language']->getText('plugin_tracker_common_type', 'no_view_permission'));
     }
 }
예제 #2
0
 /**
  * @throws SoapFault if user can't view the tracker
  */
 private function checkUserCanViewTracker(Tracker $tracker, PFUser $user)
 {
     if (!$tracker->userCanView($user)) {
         throw new Exception('Permission Denied: You are not granted sufficient permission to perform this operation.', (string) get_tracker_factory_fault);
     }
     $this->checkUserCanAccessProject($user, $tracker->getProject());
 }
예제 #3
0
 private function trackerCanBeDisplayed(Tracker $tracker, PFUser $user)
 {
     return $tracker->userCanView($user) && !$this->getTV3MigrationManager()->isTrackerUnderMigration($tracker);
 }