Don't allow role to delete published content even its their own thanks for reading my question.

I am currently working on Drupal 8 site, please consider the following roles:

Admin - Can do everything
Publisher - can do everything the Admin can do, except set up and edit new 
administrators 
Editor - Can do everything the publisher can do, except Publish content to live
Writer - Can do everything the Editor can do, except Delete published content


I have managed to satisfy the permission for the roles Admin, Publisher, and Editor, now it seems the Writer one is tricky.

The only option seems like to Enable Delete own content for Writer, but that won't solve the issue if his article was already published, he can delete it.

Is there a module that can be solved by this? Or a better approach on how to configure permissions?

Regards,
Simply search for and disable the permission "Delete any content" for any / all content types for the role of "writer".

This is also a very handy module to help you find permissions https://www.drupal.org/project/permissions_filter