I have an Ember application on the frontend consuming Drupal's JSONAPI.
Drupal has the commerce module installed.
The ember application is requesting all product_types, and needs to display information about the product types.
The product type has fields on it such as description variationType and label, but as an anonymous user, I cannot see all these attributes, only label.
It seems like this is an issue with the way The commerce module checks permissions.
if (!$access->isAllowed()) {
// If this is the default revision or the entity is not revisionable, then
// check access to the entity label. Revision support is all or nothing.
if (!$entity->getEntityType()->isRevisionable() || $entity->isDefaultRevision()) {
$label_access = $entity->access('view label', NULL, TRUE);
$entity->addCacheableDependency($label_access);
if ($label_access->isAllowed()) {
return LabelOnlyResourceObject::createFromEntity($resource_type, $entity);
Here jsonapi decides to render a limited version of the entity.
It seems like this entity needs to be made revisionable in order to pass the above check and be fully rendered.
https://github.com/drupalcommerce/commerce/blob/8.x-2.x/modules/product/src/Entity/ProductType.php
How do I make the ProductType entity revisionable?
I've found this https://www.drupal.org/docs/8/api/entity-api/making-an-entity-revisionable but it seems to be limited in it's explanation.