Allow authors to preview the draft post

In WordPress, only administrator of the site can preview of non-published posts.

What if you want to allow preview for the author as well?

Add code snippet from below gist to theme’s functions.php

https://gist.github.com/BhargavBhandari90/557fd7e1155704e4f268c2016ac536c9