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

Fix assign role for non-admin connected user #2562

Merged
merged 2 commits into from
Jun 29, 2018

Conversation

richard-cox
Copy link
Contributor

@richard-cox richard-cox commented Jun 28, 2018

Bug

  • CF non-admin
  • Assign a role to the connected user to a space without any existing roles
  • CF permissions section in store did not have this section so exception was thrown when accessing it
  • This would affect users who create a space and then try to assign themselves the dev role to create an app.

Fix

  • Ensure we fall back to an empty space or org when we attempt to change the store permissions on user role change.
  • In theory there should always be an org entity for non admins, as they will have to be the 'org user' to see it, but covered case.
  • Code also covers path when a user removes a role, however code should never be hit (permissions exist to remove).

Bug
- CF non-admin
- Assign a role to the connected user to a space without any existing roles
- Store permissions section did not have this section so exception was thrown
- This would affect users who create a space and then try to assign themselves the dev role to create an app
Fix
- Ensure we fall back to an empty space or org when we attempt to change the store permissions on user role change
@cfdreddbot
Copy link

Hey richard-cox!

Thanks for submitting this pull request! I'm here to inform the recipients of the pull request that you and the commit authors have already signed the CLA.

@codecov
Copy link

codecov bot commented Jun 28, 2018

Codecov Report

Merging #2562 into v2-master will decrease coverage by <.01%.
The diff coverage is 31.25%.

@@              Coverage Diff              @@
##           v2-master    #2562      +/-   ##
=============================================
- Coverage      70.42%   70.42%   -0.01%     
=============================================
  Files            594      594              
  Lines          25135    25139       +4     
  Branches        5674     5676       +2     
=============================================
+ Hits           17701    17703       +2     
- Misses          7434     7436       +2

@nwmac nwmac self-requested a review June 29, 2018 09:14
Copy link
Contributor

@nwmac nwmac left a comment

Choose a reason for hiding this comment

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

LGTM

@nwmac nwmac merged commit ff16402 into v2-master Jun 29, 2018
@nwmac nwmac deleted the fix-add-role-new-org-space branch June 29, 2018 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants