modules/quanthub_core/src/Plugin/Action/QuanthubDraft.php [26:53]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
    if ($object instanceof Node) {
      $can_update = $object->access('update', $account, TRUE);
      $can_edit = $object->access('edit', $account, TRUE);

      $access = $can_edit->andIf($can_update);

      return $return_as_object ? $access : $access->isAllowed();
    }

    return FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function execute(ContentEntityInterface $entity = NULL) {
    if (!$state = $entity->get('moderation_state')->getString()) {
      return $this->t(":title  - can't change state",
        [
          ':title' => $entity->getTitle(),
        ]
      );
    }

    // Nothing to do for draft, moved archive draft.
    // Published node we firstly move to archive than to draft.
    switch ($state) {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



modules/quanthub_core/src/Plugin/Action/QuanthubPublish.php [26:54]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
    if ($object instanceof Node) {
      $can_update = $object->access('update', $account, TRUE);
      $can_edit = $object->access('edit', $account, TRUE);

      $access = $can_edit->andIf($can_update);

      return $return_as_object ? $access : $access->isAllowed();
    }

    return FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function execute(ContentEntityInterface $entity = NULL) {
    if (!$state = $entity->get('moderation_state')->getString()) {
      return $this->t(":title  - can't change state",
        [
          ':title' => $entity->getTitle(),
        ]
      );
    }

    // Nothing to do here for published.
    // Moved draft to published and for archive firstly move to draft
    // than to published.
    switch ($state) {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



