summaryrefslogtreecommitdiffstats
path: root/models/org.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/org.go')
-rw-r--r--models/org.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/models/org.go b/models/org.go
index 149d6f7aa7..b7db32ef16 100644
--- a/models/org.go
+++ b/models/org.go
@@ -370,6 +370,10 @@ func getOwnedOrgsByUserID(sess *xorm.Session, userID int64) ([]*User, error) {
// HasOrgVisible tells if the given user can see the given org
func HasOrgVisible(org *User, user *User) bool {
+ return hasOrgVisible(x, org, user)
+}
+
+func hasOrgVisible(e Engine, org *User, user *User) bool {
// Not SignedUser
if user == nil {
if org.Visibility == structs.VisibleTypePublic {
@@ -382,7 +386,7 @@ func HasOrgVisible(org *User, user *User) bool {
return true
}
- if org.Visibility == structs.VisibleTypePrivate && !org.IsUserPartOfOrg(user.ID) {
+ if org.Visibility == structs.VisibleTypePrivate && !org.isUserPartOfOrg(e, user.ID) {
return false
}
return true