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

Ensure that space application supporter can get/list buildpacks #2319

Conversation

philippthun
Copy link
Member

  • Add tests that check permissions.

Closes #2217.

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

- Add tests that check permissions.

Co-authored-by: Will Gant <[email protected]>
@sweinstein22 sweinstein22 requested a review from monamohebbi June 8, 2021 17:02
@sweinstein22 sweinstein22 added the space-application-supporter https://github.com/cloudfoundry/cfar-proposals/issues/22 label Jun 8, 2021
@sweinstein22 sweinstein22 self-requested a review June 11, 2021 17:51
Copy link
Contributor

@sweinstein22 sweinstein22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acceptance

Confirmed user only has space_application_supporter and organization_user roles:

$ cf curl /v3/roles?user_guids="0776980f-9ea5-499a-9a23-ecc09d0d5b39"
{
  ...
  "resources": [
    {
      "guid": "7555955f-5baf-4700-93e1-3952ef664a1f",
      "type": "organization_user",
      "relationships": {
        "user": {
          "data": {
            "guid": "0776980f-9ea5-499a-9a23-ecc09d0d5b39"
          }
        },
      ...
    },
    {
      "guid": "e158488c-2b95-4806-a6f1-68df9dde8fdc",
      "type": "space_application_supporter",
      "relationships": {
        "user": {
          "data": {
            "guid": "0776980f-9ea5-499a-9a23-ecc09d0d5b39"
          }
        },
       ...
  ]
}

Ran cf curl against /v3/buildpacks and /v3/buildpacks/:guid as both a space developer and a space application supporter. Confirmed that there was no diff, and manually confirmed that output looked correct:

$ diff /tmp/space-dev-buildpacks /tmp/space-app-supporter-buildpacks

$ diff /tmp/space-dev-buildpack-guid /tmp/space-app-supporter-buildpack-guid

Code Review

Changes looks good, converts to using the shared example structure for permissions tests. As the endpoint was already available to all roles only testing changes were required.

Docs

No changes required, as the docs already indicate that these two endpoints are available to all roles.

Looks good, thanks for the PR!

@sweinstein22 sweinstein22 merged commit ac5ae1b into cloudfoundry:main Jun 11, 2021
@sweinstein22 sweinstein22 removed the request for review from monamohebbi June 11, 2021 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
space-application-supporter https://github.com/cloudfoundry/cfar-proposals/issues/22
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow space application supporter to access specific buildpacks endpoints.
3 participants