feat(web): Add org removal functionality to admin user details page (#38013)

Signed-off-by: techknowlogick <techknowlogick@gitea.com>
Signed-off-by: Karthik Bhandary <34509856+karthikbhandary2@users.noreply.github.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.com>
Co-authored-by: bircni <bircni@icloud.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Karthik Bhandary
2026-08-29 07:50:04 +00:00
committed by GitHub
co-authored by techknowlogick bircni wxiaoguang
parent 3c0bfe9463
commit 88974d2db9
7 changed files with 189 additions and 19 deletions
+7
View File
@@ -56,6 +56,13 @@ func GetOrganizationCount(ctx context.Context, u *user_model.User) (int64, error
Count(new(OrgUser))
}
func GetUserOrganizations(ctx context.Context, uid int64) (ret []*Organization, err error) {
err = db.GetEngine(ctx).Select("`user`.*").
Join("INNER", "org_user", "org_user.org_id = `user`.id").
Where("org_user.uid=?", uid).Find(&ret)
return ret, err
}
// IsOrganizationOwner returns true if given user is in the owner team.
func IsOrganizationOwner(ctx context.Context, orgID, uid int64) (bool, error) {
ownerTeam, err := GetOwnerTeam(ctx, orgID)