Prohibit editing pending posts for contributors

In order to prohibit editing pending posts for contributors use this code recipe:

You may insert this code into the active theme’s functions.php file or install it as a must use plugin.