The problem
- Say, I have custom rest resource (node) type "foobar"
- If
Foobar.field_allow_api_access is FALSE, then nobody should be able to access it through the API
- The node remains accessible through the Drupal interface, but not through the API
- I'm thinking about implementing a
Foobar::access() method to do this check, but there isn't a clear way for me to get the entity which is in context
How would you recommend achieving this? Any help will be appreciated. Thanks.
The problem
Foobar.field_allow_api_accessisFALSE, then nobody should be able to access it through the APIFoobar::access()method to do this check, but there isn't a clear way for me to get the entity which is in contextHow would you recommend achieving this? Any help will be appreciated. Thanks.