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

Enable permission check for updating a billing account #581

Open
maxceem opened this issue Sep 29, 2020 · 2 comments
Open

Enable permission check for updating a billing account #581

maxceem opened this issue Sep 29, 2020 · 2 comments
Assignees
Labels
Milestone

Comments

@maxceem
Copy link
Contributor

maxceem commented Sep 29, 2020

Some time ago we had to disable permission check for updating a billing account due to some use case got broken, see commit e491fff.

Though as now we had removed the permission check for updating a billing account in the Legacy Project Processor (see issue topcoder-platform/legacy-project-processor#12) we rely on this validation in the Project Service so we have to consider re-enable it.

FYI @vikasrohit

@vikasrohit
Copy link

@acshields we need to discuss this

@maxceem
Copy link
Contributor Author

maxceem commented Sep 29, 2020

As per discussion on Slack with Vikas:

  • we need to think more about the billing account permission check because the check we had earlier was preventing a user from updating the billing account for project but it was not validating if the same user actually has permissions on the billilng account or not, which is more important and I guess it is what was implemented in legacy project processor
  • we can use the next V3 endpoint for getting billing accounts which users has access to:
     curl 'https://api.topcoder-dev.com/v3/me/billing-accounts' \
       -H 'pragma: no-cache' \
       -H 'cache-control: no-cache' \
       -H 'accept: application/json, text/plain, */*' \
       -H 'authorization: Bearer <USER TOKEN> \
       -H 'sec-fetch-site: cross-site' \
       -H 'sec-fetch-mode: cors' \
       -H 'sec-fetch-dest: empty' \
       -H 'accept-language: en-US,en;q=0.9' \
       --compressed
    
  • m2m calls can still perform the operation if they has the scope of billing account updates, BUT no users can do it, even if they are administrators. User can only do this operation, if they have access to the billing account as per above.

@vikasrohit vikasrohit modified the milestones: 3.1.0, Backlog Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants