1

I would like to use Drupal as a decoupled system, sourcing its content by using Gatsby. Having set it all up, I would like my Drupal nodes not to be accessed by random unauthenticated users so I removed the permission from 'View Content'.

Having done that now I can't access the content by my Front end service which uses JSON API (unauthenticated of course).

What's the method to remove the node pages from the site and leave only the admin backend, while allowing to access the content using JSON API ?

2 Answers 2

2

If you're working with unauthenticated consumers, the Rabbit Hole module has the means to disable node/* routes without using the user role/permission system.

The Rabbit Hole module has a sub-module Rabbit Hole nodes that, when enabled, will let you disable node/* routes. This should leave open your jsonapi/* endpoints to anonymous consumers.

1

Another solution I found was to remove the 'view published content' permission for anonymous users, and activate the Basic Authorisation module to use for JSON API requests.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.