Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drupal Apigee API Product RBAC not filtering API Products based on Roles #1098

Open
urbanenomad opened this issue Nov 22, 2024 · 4 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@urbanenomad
Copy link

Description

A clear and concise description of what the bug is.

Apigee Info

We have both apigee hybrid and apigee-x instances that we want to support

Steps to Reproduce

Steps to reproduce the behavior:

  1. Enable apigee API product RBAC
    Screenshot 2024-11-21 at 9 29 54 AM

  2. Configured Custom Attribute on some test apigee products
    Screenshot 2024-11-21 at 9 28 53 AM

Actual Behavior

  • Non-admin account that was set to one of the attirbute roles still shows all products even more than if we did just products by visiblity. It now shows all the products.
    Screenshot 2024-11-22 at 12 07 00 PM

  • We also did not enable "Bypass API product access control" nor did we enable "Show API products with missing or empty attribute to everyone"

Expected Behavior

We would have hoped to see when a developer trys to create an App they only see the API products that have their role in the custom attribute

Notes

Add any other context about the problem here.

Version Info

Drupal 10.3.6

Modules:
Apigee: 3.0.10
Apigee API Catalog 3.0.8

@urbanenomad urbanenomad added the bug Something isn't working label Nov 22, 2024
@kedarkhaire
Copy link
Collaborator

Hi @urbanenomad
Thanks for creating a ticket here. We will look into it.
Thanks!

@urbanenomad
Copy link
Author

Is there any updates on this?

@urbanenomad
Copy link
Author

Hey so I think I figured out the issue at the following lines.

$result = AccessResult::neutral("{$operation} is not allowed on {$entity->label()} API product.");

the line should read like the following.

$result = AccessResult::forbidden("{$operation} is not allowed on {$entity->label()} API product.");

Same for this line.

$result = AccessResult::neutral("{$operation} is not allowed on {$entity->label()} API product.");

$result = AccessResult::forbidden("{$operation} is not allowed on {$entity->label()} API product.");

This resulted with the correct output on the App Create page.

@kedarkhaire
Copy link
Collaborator

Hi @urbanenomad
Thanks for the investigation, Can you please create the PR for the same, we will run the tests and check.
If all good, then we will push the changes in next release.

@kedarkhaire kedarkhaire self-assigned this Dec 12, 2024
urbanenomad added a commit to urbanenomad/apigee-edge-drupal that referenced this issue Dec 12, 2024
Changed from neutral to forbidden so that API Products do not show up on the assign operation or Create App when using the RBAC service to control access to API Products.  This is to solve issue apigee#1098
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants