class GetUserTaskCommand extends TaskCommand<Task> {

    @Override
    public Task execute(Context cntxt) {
        TaskContext context = (TaskContext) cntxt;

        Task task = context.getTaskQueryService().getTaskInstanceById(taskId);

        if (task == null) {
            throw new IllegalStateException("Unable to find task with id " + taskId);
        }

        if (!checkUserPermissions(userId,
                                  task,
                                  context)) {
            throw new PermissionDeniedException("User " + userId + " isn't allowed to see the task " + taskId);
        }

        return task;
    }

    public  GetUserTaskCommand();
    public  GetUserTaskCommand(String userId,
                              long taskId);

}