File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import (
12
12
"code.gitea.io/gitea/models/perm"
13
13
user_model "code.gitea.io/gitea/models/user"
14
14
"code.gitea.io/gitea/modules/setting"
15
+ "code.gitea.io/gitea/modules/structs"
15
16
)
16
17
17
18
// Organization contains organization context
@@ -69,6 +70,20 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
69
70
return
70
71
}
71
72
org := ctx .Org .Organization
73
+
74
+ // Handle Visibility
75
+ if org .Visibility != structs .VisibleTypePublic && ! ctx .IsSigned {
76
+ // We must be signed in to see limited or private organizations
77
+ ctx .NotFound ("OrgAssignment" , err )
78
+ return
79
+ }
80
+
81
+ if org .Visibility == structs .VisibleTypePrivate {
82
+ requireMember = true
83
+ } else if ctx .IsSigned && ctx .Doer .IsRestricted {
84
+ requireMember = true
85
+ }
86
+
72
87
ctx .ContextUser = org .AsUser ()
73
88
ctx .Data ["Org" ] = org
74
89
Original file line number Diff line number Diff line change @@ -39,11 +39,6 @@ func Home(ctx *context.Context) {
39
39
40
40
org := ctx .Org .Organization
41
41
42
- if ! organization .HasOrgOrUserVisible (ctx , org .AsUser (), ctx .Doer ) {
43
- ctx .NotFound ("HasOrgOrUserVisible" , nil )
44
- return
45
- }
46
-
47
42
ctx .Data ["PageIsUserProfile" ] = true
48
43
ctx .Data ["Title" ] = org .DisplayName ()
49
44
if len (org .Description ) != 0 {
You can’t perform that action at this time.
0 commit comments