summaryrefslogtreecommitdiffstats
path: root/models/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/user.go')
-rw-r--r--models/user.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/models/user.go b/models/user.go
index 9ddd262aed..dc8ae7e0f8 100644
--- a/models/user.go
+++ b/models/user.go
@@ -1469,7 +1469,7 @@ type SearchUserOptions struct {
UID int64
OrderBy SearchOrderBy
Page int
- Private bool // Include private orgs in search
+ Visible []structs.VisibleType
OwnerID int64 // id of user for visibility calculation
PageSize int // Can be smaller than or equal to setting.UI.ExplorePagingNum
IsActive util.OptionalBool
@@ -1492,8 +1492,9 @@ func (opts *SearchUserOptions) toConds() builder.Cond {
cond = cond.And(keywordCond)
}
- if !opts.Private {
- // user not logged in and so they won't be allowed to see non-public orgs
+ if len(opts.Visible) > 0 {
+ cond = cond.And(builder.In("visibility", opts.Visible))
+ } else {
cond = cond.And(builder.In("visibility", structs.VisibleTypePublic))
}