fix: add InUserIDs query to query of user grants (#10741)

# Which Problems Are Solved

Currently there is only the option to either filter for all usergrants
of an organization or the usergrants of a singluar user.

# How the Problems Are Solved

Add the option to provide a list of userIDs to query user grants.

# Additional Changes

Fixed internal typo for function.

# Additional Context

Closes #9675
This commit is contained in:
Stefan Benz
2025-10-07 04:56:20 +00:00
committed by GitHub
parent 4aac34d93b
commit 6da380628d
6 changed files with 67 additions and 2 deletions
+6
View File
@@ -107,6 +107,8 @@ func UserGrantQueryToQuery(ctx context.Context, query *user_pb.UserGrantQuery) (
return UserGrantWithGrantedQueryToModel(ctx, q.WithGrantedQuery)
case *user_pb.UserGrantQuery_UserTypeQuery:
return UserGrantUserTypeQueryToModel(q.UserTypeQuery)
case *user_pb.UserGrantQuery_InUserIdsQuery:
return UserGrantInUserIDsQueryToModel(q.InUserIdsQuery)
default:
return nil, errors.New("invalid query")
}
@@ -156,6 +158,10 @@ func UserGrantUserIDQueryToModel(q *user_pb.UserGrantUserIDQuery) (query.SearchQ
return query.NewUserGrantUserIDSearchQuery(q.UserId)
}
func UserGrantInUserIDsQueryToModel(q *user_pb.UserGrantInUserIDsQuery) (query.SearchQuery, error) {
return query.NewUserGrantInUserIDsSearchQuery(q.InUserIds)
}
func UserGrantUserNameQueryToModel(q *user_pb.UserGrantUserNameQuery) (query.SearchQuery, error) {
return query.NewUserGrantUsernameQuery(q.UserName, object.TextMethodToQuery(q.Method))
}