feat(web): Add org removal functionality to admin user details page - #38013
Merged
Conversation
karthikbhandary2
marked this pull request as ready for review
June 7, 2026 07:50
lunny
reviewed
Jun 7, 2026
lunny
reviewed
Jun 8, 2026
lunny
reviewed
Jun 9, 2026
karthikbhandary2
force-pushed
the
org-remove
branch
from
June 9, 2026 11:21
40e88d1 to
8883f15
Compare
Signed-off-by: techknowlogick <techknowlogick@gitea.com>
Signed-off-by: Karthik Bhandary <34509856+karthikbhandary2@users.noreply.github.com>
Contributor
Author
|
Anything else? |
Contributor
Author
|
@lunny please check and let me know when you can |
bircni
approved these changes
Aug 23, 2026
Contributor
Author
|
@bircni one question. What is considered worthy of |
Contributor
|
I believe it needs to be carefully reviewed and have some clean-ups. For example: we have removed Also suggest to follow: https://github.com/go-gitea/gitea/blob/main/docs/guidelines-backend.md#golang-html-template (especially for the |
wxiaoguang
approved these changes
Aug 29, 2026
bircni
enabled auto-merge (squash)
August 29, 2026 07:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issues
Closes #37071
Summary
Adds the ability for administrators to remove users from organizations directly from the admin user details page (
/-/admin/users/{userid}). This feature provides both individual organization removal and bulk removal from all organizations.Motivation
Currently, administrators need to navigate to each organization separately to remove a user from multiple organizations. This enhancement streamlines user management by allowing admins to perform these actions directly from the user details page.
Implementation
Backend (Go)
routers/web/admin/users.go(Modified)RemoveUserFromOrg()- Removes a user from a single organizationRemoveUserFromAllOrgs()- Removes a user from all organizationsorg_service.RemoveOrgUser()serviceorg_serviceimportrouters/web/web.go(Modified)/{userid}/orgs/{orgid}/remove/{userid}/orgs/remove-allFrontend (Templates)
templates/admin/user/view.tmpl(Modified)templates/admin/user/view_orgs.tmpl(New)explore/user_list.tmplbut with admin-specific actionsLocalization
options/locale/locale_en-US.json(Modified)Added:
admin.users.org_removed- Success message for single removaladmin.users.all_orgs_removed- Success message for bulk removaladmin.users.no_orgs_to_remove- Info message when user has no organizationsadmin.users.no_orgs_removed- Error message when no removals succeededadmin.users.some_orgs_removed- Partial success message with countadmin.users.remove_all_orgs_title- Modal titleadmin.users.remove_all_orgs_desc- Modal confirmation messageTests
tests/integration/admin_user_org_test.go(New)TestAdminRemoveUserFromOrg- Tests single organization removalTestAdminRemoveUserFromAllOrgs- Tests bulk removal from all organizationsFeatures
UI Changes
Before
No option to remove users from organizations on the admin user page.
After
Screenshots
Security Considerations
org_service.RemoveOrgUser()which includes proper permission checksTesting
Run integration tests:
go test -v ./tests/integration -run TestAdminRemoveUserFromDevelopment Note
This PR was developed with assistance from Amazon Q Developer and Gemini.