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

Allow space application supporter to access specific job endpoints. #2224

Closed
monamohebbi opened this issue Apr 21, 2021 · 3 comments · Fixed by #2316
Closed

Allow space application supporter to access specific job endpoints. #2224

monamohebbi opened this issue Apr 21, 2021 · 3 comments · Fixed by #2316
Labels
space-application-supporter https://github.com/cloudfoundry/cfar-proposals/issues/22

Comments

@monamohebbi
Copy link
Contributor

Issue

Allow space application supporter to access specific job endpoints.

Context

We are introducing a new role and we want to make sure it has the right access.

Expected result

A space application support should be able access the following endpoints:

GET /v3/jobs/:guid

Acceptance

A space application supporter would see the same info as a space developer assigned to the same space for these and only these job endpoints.

@monamohebbi monamohebbi added the space-application-supporter https://github.com/cloudfoundry/cfar-proposals/issues/22 label Apr 21, 2021
@monamohebbi monamohebbi added this to To do in Space Supporter via automation Apr 21, 2021
@philippthun philippthun moved this from To do to In progress in Space Supporter Jun 4, 2021
@philippthun
Copy link
Member

@monamohebbi @sweinstein22 - There is a deviation between the documentation of the GET /v3/jobs/:guid endpoint and its implementation. As there is no permissions check in the coding (jobs_controller.rb), all authenticated users can access this endpoint (i.e. including Org Auditor, Org Billing Manager and users with no role at all). Shall the documentation be fixed or the implementation?

If we decide to simply adapt the documentation, I would also think that we don't even need tests and can simply move this issue to the Acceptance column.

@sweinstein22
Copy link
Contributor

sweinstein22 commented Jun 4, 2021

Hi @philippthun , I checked in with folks who have product context and the behavior should be that jobs are visible to everyone who has an assigned role, which means a slight change on both sides. On the implementation side, users with no role at all should not be able to hit GET /v3/jobs/:guid. On the documentation side we can change the permissions to say "All Roles". Thanks for catching that!

@philippthun
Copy link
Member

@sweinstein22 I've now adjusted the documentation (e.g. "All Roles" are permitted) and added some tests. I did not adjust the implementation as the code seems to be in line with other endpoints (e.g. /v3/stacks/:guid) that also claim to be accessible for "All Roles". So even a user with no_role has access; as long as the cloud_controller.read scope is set.

@monamohebbi monamohebbi moved this from In progress to Acceptance in Space Supporter Jun 10, 2021
Space Supporter automation moved this from Acceptance to Done Jun 11, 2021
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
4 participants