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 (
1212 "code.gitea.io/gitea/models/perm"
1313 user_model "code.gitea.io/gitea/models/user"
1414 "code.gitea.io/gitea/modules/setting"
15+ "code.gitea.io/gitea/modules/structs"
1516)
1617
1718// Organization contains organization context
@@ -69,6 +70,20 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
6970 return
7071 }
7172 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+
7287 ctx .ContextUser = org .AsUser ()
7388 ctx .Data ["Org" ] = org
7489
Original file line number Diff line number Diff line change @@ -39,11 +39,6 @@ func Home(ctx *context.Context) {
3939
4040 org := ctx .Org .Organization
4141
42- if ! organization .HasOrgOrUserVisible (ctx , org .AsUser (), ctx .Doer ) {
43- ctx .NotFound ("HasOrgOrUserVisible" , nil )
44- return
45- }
46-
4742 ctx .Data ["PageIsUserProfile" ] = true
4843 ctx .Data ["Title" ] = org .DisplayName ()
4944 if len (org .Description ) != 0 {
You can’t perform that action at this time.
0 commit comments