User based node saving I have two roles Editor and Manager. Editor can add nodes as unpublished and manager can review the nodes and approve/publish them in website.

For administration I am using default SEVEN theme for adding/editing nodes. How can i hide "Save and Publish" button to editor role only?

Can it possible by calling a template hook node_presave? I tried below code but not worked.

 function seven_node_presave($node) {
    global $user;

    if (in_array('editor',$user-&gt;roles)){
        $node-&gt;status = FALSE;
    }

}


if any body can suggest solution for this?
How can i hide "Save and Publish" button to editor role only?


You can use two ways. 


Simple ways. Enable module Content Moderation in core and set permission by roles.
Use function hook_form_node_form_alter()



global $user;

if (in_array('editor',$user-&gt;roles)){
   $node-&gt;status = FALSE;
}



Drupal 8 have some different. Global user replace by
\Drupal::currentUser()

and $user->roles replace by 

\Drupal::currentUser()-&gt;getRoles()