How to change permissions to a role when a content is set as published I have been working with Drupal 8 and need help: I have a News content type, and an Editor role type. This Editor role can view/edit/delete his own content. I want that Editor roles can't edit/delete their own content when this content is published by Admin roles.

I have been searched and I found Permissions by fields, Permissions by terms, Groups and Custom Publish options modules, but I can't make this works.

Maybe this can be done with php, but I don't know how.

Please, any help?
You could use the following code.

use Drupal\Core\Access\AccessResult;
use Drupal\node\NodeInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\user\Entity;

function mymodule_node_access(NodeInterface $node, $op, AccountInterface $account) {
  $type = $node-&gt;getType();
  // Is it published?
  $nodeIsPublished = $node-&gt;isPublished();
  if ($type == 'news' &amp;&amp; $operation != 'view' &amp;&amp; $nodeIsPublished == 1) {
    if($account-&gt;hasRole('rolename')) {
       return  AccessResult::forbidden();
    }
    else {
      return AccessResult::allowed();
    }
  }
  return AccessResult::neutral();
}


Also, the Override Node Options module allows permissions to be set for each field within the Authoring information and Publishing options fieldsets on the node form.