How to make the whole site accessible to authenticated users only?

Hi,

I would like my whole Drupal site to be accessible to authenticated users only.
How can I do that?
I have created a landing page to replace the standard 403 error page, inviting users to sign in.

Site: cern.ch/test-guides.

Best,

François

Hi Francois,

Go to People->Permissions tab and search for View published content.

Check the boxes only for the roles that you want to have access to your website.

The downside of this is that the users won’t be able to see your custom 404 page.

If you want them to view the custom 404 and not the rest of the content then you need to enable the Content Access module.

Once you have enabled it go to Structure->Content types and for each content type edit the access control settings so it can be viewed only by the selected roles.

I have (finally!) finished the new guides site. Your solution with the Content Access module works well to limit access to the whole site to authenticated user only but have a nice message for those who are not authenticated.

  1. I have created a content type just for my customized Access Denied page and named it “No access”
  2. I have activated the “Content Access” module in the “Extend” menu
  3. I went through every Content Types (excepting “No access” of course), opened the “Access control” tab and unchecked “Anonymous users” any access to the content type, then saved.
  4. I created a customized Access Denied page (node) based on “No access” content type
  5. I have referenced this new node as “Default 403 (access denied) page” in Configuration > Basic Site Settings >

Works fine.

1 Like

Hi Francois

Thanks for posting your solution!

Thanks!