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

Give SuperAdmin DefaultRole on PUT /me #2632

Merged
merged 4 commits into from
Dec 21, 2017

Conversation

desa
Copy link
Contributor

@desa desa commented Dec 20, 2017

Previously, SuperAdmins were given the admin role in an organization
when they switched into it (via a PUT to /me). This is undesireable for
the comonitoring organization. This PR gives SuperAdmins the default
role for the organization when they switch into it.

Additionally, this makes it so that when any user switches organizations, they see a longer-displayed notification that clarifies which organization and what role they have switched into, using the terminology logged in. And this will happen regardless of whether they were a SuperAdmin or not, and whether (if SuperAdmin) that SuperAdmin had a role in the org before or not.

  • CHANGELOG.md updated with a link to the PR (not the Issue)
  • Rebased/mergable
  • Tests pass

Connect #2641
Connect #2636

Previously, SuperAdmins were given the admin role in an organization
when they switched into it (via a PUT to /me). This is undesireable for
the comonitoring organization. This PR gives SuperAdmins the default
role for the organization when they switch into it.
@desa desa requested review from nhaugo and jaredscheib December 20, 2017 22:24
@jaredscheib
Copy link
Contributor

jaredscheib commented Dec 20, 2017

  • We'll need to change the notification displayed to the user for this as well to show what the inherited role is. I'll review shortly.

Show that notification for 4 seconds.
Change copy from 'signed in' to 'logged in'.
Remove concept of userHasRoleInOrg since now obsolete.
Copy link
Contributor

@jaredscheib jaredscheib left a comment

Choose a reason for hiding this comment

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

Tested the server & works as expected. Code is good. Nice work.

Added some client code which should be reviewed.

Copy link
Contributor

@alexpaxton alexpaxton left a comment

Choose a reason for hiding this comment

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

LGTM

@cryptoquick cryptoquick self-requested a review December 21, 2017 01:43
Copy link
Contributor

@cryptoquick cryptoquick left a comment

Choose a reason for hiding this comment

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

Had to reset my DB due to ISE issue. Will open a new issue for that. Then discovered the code on this branch didn't work in the cases I tried. @desa is coming up with a fix.

@jaredscheib jaredscheib force-pushed the feature/superadmin_gets_default_role branch from 170c649 to 6bf2d25 Compare December 21, 2017 01:48
Copy link
Contributor

@cryptoquick cryptoquick left a comment

Choose a reason for hiding this comment

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

Was able to get everything working, the way I was testing earlier wasn't taking into account the expected flow, being, that the first user of a new organization will always be admin, but subsequent users will be that of the default user. approv'd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants