You are here

public static function MaestroEngine::canUserExecuteTask in Maestro 3.x

Same name and namespace in other branches
  1. 8.2 src/Engine/MaestroEngine.php \Drupal\maestro\Engine\MaestroEngine::canUserExecuteTask()

Determines if a user is assigned to execute a specific task.

Parameters

int $queueID: The Maestro Queue ID.

int $userID: The user ID you wish to determine if they can execute the task identified by the Queue ID.

12 calls to MaestroEngine::canUserExecuteTask()
MaestroContentTypeCompleteTask::buildForm in src/Form/MaestroContentTypeCompleteTask.php
Form constructor.
MaestroContentTypeCompleteTask::submitForm in src/Form/MaestroContentTypeCompleteTask.php
Form submission handler.
MaestroInteractiveFormBase::buildForm in src/Form/MaestroInteractiveFormBase.php
Form constructor.
MaestroInteractiveFormBase::completeForm in src/Form/MaestroInteractiveFormBase.php
Ajax callback helper funciton that simply helps us separate the save/complete of a task with an optional ajax handler to close the dialog and/or do a redirect if the user has jumped out of the modal.
MaestroInteractiveFormBase::submitForm in src/Form/MaestroInteractiveFormBase.php
Form submission handler.

... See full list

File

src/Engine/MaestroEngine.php, line 698

Class

MaestroEngine
Class MaestroEngine.

Namespace

Drupal\maestro\Engine

Code

public static function canUserExecuteTask($queueID, $userID) {
  $queueIDs = self::getAssignedTaskQueueIds($userID);
  $returnValue = FALSE;
  if (array_search($queueID, $queueIDs) !== FALSE) {
    $returnValue = TRUE;
  }
  return $returnValue;
}