mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-08 22:13:26 +09:00
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:
co-authored by
techknowlogick
bircni
wxiaoguang
parent
3c0bfe9463
commit
88974d2db9
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user