Check this plugin. I’ve used it and it’s quite versatile regarding user roles and user capabilities.
You can also add conditional statements in your php files, like this:
if (!current_user_can('some_capability_you_added')) {
echo "You don't have permission for it!";
return;
}
You can output that sentence or nothing at all.