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

Add Super admin routes for user and orga management #7196

Merged
merged 15 commits into from
Jul 24, 2023
Merged

Conversation

frcroth
Copy link
Member

@frcroth frcroth commented Jul 10, 2023

URL of deployed dev instance (used for testing):

  • https://___.webknossos.xyz

Steps to test:

  • Create a new organization via POST api/organizations with sample2 user (This allows you to specify an existing user as admin) / use /auth/createOrganizationWithAdmin (This creates a new user as admin)
  • Add user sample to this organization via POST api/organizations/:name/addUser
  • Create a new user in this organization via POST auth/createUserInOrganization/:name
  • Validate that all of this only works for super users.

Issues:


(Please delete unneeded items, merge only when none are left open)

@frcroth frcroth requested a review from fm3 July 10, 2023 12:55
@frcroth frcroth marked this pull request as ready for review July 10, 2023 12:55
@frcroth frcroth self-assigned this Jul 10, 2023
Copy link
Member

@fm3 fm3 left a comment

Choose a reason for hiding this comment

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

Thanks for having a look at this!

I think your version works well, but it could be simplified and be made more feature-complete by reusing some of the existing methods used during user signup/organization switching. I added some comments pointing to those.

Maybe you could have a look at that? Feel free to reorganize some of those, if it makes things easier, none of this is set in stone :)

We might even alter the existing routes (of course then we would have to adapt the frontend).

conf/webknossos.latest.routes Show resolved Hide resolved
app/controllers/UserController.scala Outdated Show resolved Hide resolved
app/controllers/OrganizationController.scala Show resolved Hide resolved
@frcroth frcroth requested a review from fm3 July 17, 2023 12:12
Copy link
Member

@fm3 fm3 left a comment

Choose a reason for hiding this comment

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

Almost there :)

app/controllers/OrganizationController.scala Outdated Show resolved Hide resolved
app/models/user/UserService.scala Outdated Show resolved Hide resolved
conf/messages Outdated Show resolved Hide resolved
@frcroth frcroth requested a review from fm3 July 24, 2023 09:49
Copy link
Member

@fm3 fm3 left a comment

Choose a reason for hiding this comment

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

🎉

@frcroth frcroth merged commit 539fd42 into master Jul 24, 2023
@frcroth frcroth deleted the super-user-routes branch July 24, 2023 11:36
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.

Super admin routes for user and orga management
3 participants