Esempio n. 1
0
 /**
  * @param TaskInterface $task
  * @return $this
  */
 public function addTask(TaskInterface $task)
 {
     $this->tasks[$task->getTaskConfiguration()->getId()] = $task;
     ksort($this->tasks);
     return $this;
 }
 /**
  * @param Token $token
  * @param TaskInterface $task
  * @return boolean
  */
 public function tokenHasAccessToTask(Token $token, TaskInterface $task)
 {
     $tokenRecord = $this->getDatabaseConnection()->exec_SELECTgetSingleRow('allowed_tasks', 'tx_rpc_token', sprintf("token = '%s' AND validated = 1", $token->getTokenValue()));
     return is_array($tokenRecord) && in_array($task->getTaskConfiguration()->getId(), GeneralUtility::trimExplode(',', $tokenRecord['allowed_tasks']));
 }