public function canPublish()
    {
        // Override any default behaviour, to allow queuedjobs to complete
        if ($this->isPublishJobRunning()) {
            return true;
        }

        if ($active = $this->getWorkflowInstance()) {
            $publish = $active->canPublishTarget($this->owner);
            if (!is_null($publish)) {
                return $publish;
            }
        }

        // use definition to determine if publishing directly is allowed
        $definition = $this->getWorkflowService()->getDefinitionFor($this->owner);

        if ($definition) {
            if (!Security::getCurrentUser()) {
                return false;
            }
            $member = Security::getCurrentUser();

            $canPublish = $definition->canWorkflowPublish($member, $this->owner);

            return $canPublish;
        }
    }