mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-28 13:15:33 +01:00
Update usergroups API to support search by group_name
Add group_name parameter to GET usergroups API Related to issue #16408 UI should also switch from search api to usergroups list api Signed-off-by: stonezdj <stonezdj@gmail.com>
This commit is contained in:
parent
374ec5793e
commit
97a64d551d
@ -2768,7 +2768,7 @@ paths:
|
|||||||
/usergroups:
|
/usergroups:
|
||||||
get:
|
get:
|
||||||
summary: Get all user groups information
|
summary: Get all user groups information
|
||||||
description: Get all user groups information
|
description: Get all user groups information, it is open for system admin
|
||||||
operationId: listUserGroups
|
operationId: listUserGroups
|
||||||
tags:
|
tags:
|
||||||
- usergroup
|
- usergroup
|
||||||
@ -2781,6 +2781,11 @@ paths:
|
|||||||
type: string
|
type: string
|
||||||
required: false
|
required: false
|
||||||
description: search with ldap group DN
|
description: search with ldap group DN
|
||||||
|
- name: group_name
|
||||||
|
in: query
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
description: group name need to search, fuzzy matches
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: Get user group successfully.
|
description: Get user group successfully.
|
||||||
|
@ -110,6 +110,9 @@ func (u *userGroupAPI) ListUserGroups(ctx context.Context, params operation.List
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return u.SendError(ctx, err)
|
return u.SendError(ctx, err)
|
||||||
}
|
}
|
||||||
|
if params.GroupName != nil && len(*params.GroupName) > 0 {
|
||||||
|
query.Keywords["GroupName"] = &q.FuzzyMatchValue{Value: *params.GroupName}
|
||||||
|
}
|
||||||
switch authMode {
|
switch authMode {
|
||||||
case common.LDAPAuth:
|
case common.LDAPAuth:
|
||||||
query.Keywords["GroupType"] = common.LDAPGroupType
|
query.Keywords["GroupType"] = common.LDAPGroupType
|
||||||
|
Loading…
Reference in New Issue
Block a user