Skip to content

Commit 8dbe403

Browse files
fix for apiproduct access case issue (#628)
1 parent 49c0c12 commit 8dbe403

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

apigee_edge.module

+3-1
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,9 @@ function apigee_edge_api_product_access(EntityInterface $entity, $operation, Acc
515515
$result = AccessResult::allowedIfHasPermission($account, 'bypass api product access control');
516516
if ($result->isNeutral()) {
517517
// Attribute may not exists but in that case it means public.
518-
$product_visibility = $entity->getAttributeValue('access') ?? 'public';
518+
// Access attribute needs to be set to lower case
519+
// to match the portal visibilities that is set in the config apigee_edge.api_product_settings.
520+
$product_visibility = $entity->getAttributeValue('access') ? strtolower($entity->getAttributeValue('access')) : 'public';
519521
$visible_to_roles = \Drupal::config($config_name)->get('access')[$product_visibility] ?? [];
520522

521523
// A user may not have access to this API product based on the current

0 commit comments

Comments
 (0)