feat: fix LDAP filter condition will return nil if error happened (#3604)

This commit is contained in:
DacongDA
2025-02-21 13:09:39 +08:00
committed by GitHub
parent d61f9a1856
commit d78e8e9776
2 changed files with 12 additions and 7 deletions

View File

@ -302,7 +302,10 @@ func GetPaginationGroupUsers(groupId string, offset, limit int, field, value, so
func GetGroupUsers(groupId string) ([]*User, error) {
users := []*User{}
owner, _ := util.GetOwnerAndNameFromId(groupId)
owner, _, err := util.GetOwnerAndNameFromIdWithError(groupId)
if err != nil {
return nil, err
}
names, err := userEnforcer.GetUserNamesByGroupName(groupId)
if err != nil {
return nil, err
@ -314,6 +317,11 @@ func GetGroupUsers(groupId string) ([]*User, error) {
return users, nil
}
func GetGroupUsersWithoutError(groupId string) []*User {
users, _ := GetGroupUsers(groupId)
return users
}
func ExtendGroupWithUsers(group *Group) error {
if group == nil {
return nil