This answer is for Drupal 6.x, but it is probably very similar to Drupal 7 ...
Chaos Tools and Panels modules for Drupal can do this. Using the Chaos Tools add-on module "Page Manager" you can enable the page "node_view" in the section "Managing pages ..." (Creating a site → Pages).
After the "node_view" page is enabled, you will add a "Variant" (for example, "Title:" User without administrator rights ") with" Selection rules "and set the criteria to" Node Type ", then restrict it to the type of your content (for example , recommendation).
After that, the "user role" will require another "selection rule". At the same time, select both anonymous and authenticated user roles.
Next, continue the setup and select the “Single Column” layout, and then click the “gear” icon in the “Middle Column” when selecting the contents of the panel. Then you can specify an existing node (for example, a 404 node page).
Further, I would recommend setting up another “Variant” (for example, “Header User”) on the “node_view” page with the “Selection Rules” criteria set for your content type and setting user criteria for the administrator role) or user ID # 1. Then, instead of adding a 404 node as content to your panel page, you can add a "current node viewed" to the panel content. This way, administrators can see the node pages, and regular users will be redirected to your 404 page.
source share