|
|
@ -448,8 +448,9 @@ func CountOrgs(opts FindOrgOptions) (int64, error) { |
|
|
|
|
|
|
|
|
|
|
|
// HasOrgOrUserVisible tells if the given user can see the given org or user
|
|
|
|
// HasOrgOrUserVisible tells if the given user can see the given org or user
|
|
|
|
func HasOrgOrUserVisible(ctx context.Context, orgOrUser, user *user_model.User) bool { |
|
|
|
func HasOrgOrUserVisible(ctx context.Context, orgOrUser, user *user_model.User) bool { |
|
|
|
// Not SignedUser
|
|
|
|
// If user is nil, it's an anonymous user/request.
|
|
|
|
if user == nil { |
|
|
|
// The Ghost user is handled like an anonymous user.
|
|
|
|
|
|
|
|
if user == nil || user.IsGhost() { |
|
|
|
return orgOrUser.Visibility == structs.VisibleTypePublic |
|
|
|
return orgOrUser.Visibility == structs.VisibleTypePublic |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|