File tree 4 files changed +24
-11
lines changed
4 files changed +24
-11
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 {
Original file line number Diff line number Diff line change @@ -610,6 +610,12 @@ func RegisterRoutes(m *web.Route) {
610
610
}
611
611
612
612
// ***** START: Organization *****
613
+ m .Group ("/org" , func () {
614
+ m .Group ("/{org}" , func () {
615
+ m .Get ("/members" , org .Members )
616
+ }, context .OrgAssignment ())
617
+ }, ignSignIn )
618
+
613
619
m .Group ("/org" , func () {
614
620
m .Group ("" , func () {
615
621
m .Get ("/create" , org .Create )
@@ -625,7 +631,6 @@ func RegisterRoutes(m *web.Route) {
625
631
m .Get ("/pulls/{team}" , user .Pulls )
626
632
m .Get ("/milestones" , reqMilestonesDashboardPageEnabled , user .Milestones )
627
633
m .Get ("/milestones/{team}" , reqMilestonesDashboardPageEnabled , user .Milestones )
628
- m .Get ("/members" , org .Members )
629
634
m .Post ("/members/action/{action}" , org .MembersAction )
630
635
m .Get ("/teams" , org .Teams )
631
636
}, context .OrgAssignment (true , false , true ))
Original file line number Diff line number Diff line change 41
41
{{end}}
42
42
<h4 class="ui top attached header df">
43
43
<strong class="f1">{{.locale.Tr "org.people"}}</strong>
44
- {{if .IsOrganizationMember}}
45
- <div class="ui">
46
- <a class="text grey dif ac" href="{{.OrgLink}}/members"><span>{{.Org.NumMembers}}</span> {{svg "octicon-chevron-right"}}</a>
47
- </div>
48
- {{end}}
44
+ <div class="ui">
45
+ <a class="text grey dif ac" href="{{.OrgLink}}/members"><span>{{.MembersTotal}}</span> {{svg "octicon-chevron-right"}}</a>
46
+ </div>
49
47
</h4>
50
48
<div class="ui attached segment members">
51
49
{{$isMember := .IsOrganizationMember}}
You can’t perform that action at this time.
0 commit comments