@@ -32,6 +32,7 @@ export function OrgSettingsPage({ children }: OrgSettingsPageProps) {
32
32
billingMode : orgBillingMode . data ,
33
33
ssoEnabled : oidcServiceEnabled ,
34
34
orgGitAuthProviders,
35
+ isOwner : org . data ?. isOwner ,
35
36
} ) ,
36
37
[ org . data , orgBillingMode . data , oidcServiceEnabled , orgGitAuthProviders ] ,
37
38
) ;
@@ -51,8 +52,11 @@ export function OrgSettingsPage({ children }: OrgSettingsPageProps) {
51
52
) ;
52
53
}
53
54
55
+ // TODO: redirect when current page is not included in menu
56
+ const onlyForOwner = false ;
57
+
54
58
// After we've loaded, ensure user is an owner, if not, redirect
55
- if ( ! org . data ?. isOwner ) {
59
+ if ( onlyForOwner && ! org . data ?. isOwner ) {
56
60
return < Redirect to = { "/" } /> ;
57
61
}
58
62
@@ -68,27 +72,28 @@ function getTeamSettingsMenu(params: {
68
72
billingMode ?: BillingMode ;
69
73
ssoEnabled ?: boolean ;
70
74
orgGitAuthProviders : boolean ;
75
+ isOwner ?: boolean ;
71
76
} ) {
72
- const { billingMode, ssoEnabled, orgGitAuthProviders } = params ;
77
+ const { billingMode, ssoEnabled, orgGitAuthProviders, isOwner } = params ;
73
78
const result = [
74
79
{
75
80
title : "General" ,
76
81
link : [ `/settings` ] ,
77
82
} ,
78
83
] ;
79
- if ( ssoEnabled ) {
84
+ if ( isOwner && ssoEnabled ) {
80
85
result . push ( {
81
86
title : "SSO" ,
82
87
link : [ `/sso` ] ,
83
88
} ) ;
84
89
}
85
- if ( orgGitAuthProviders ) {
90
+ if ( isOwner && orgGitAuthProviders ) {
86
91
result . push ( {
87
92
title : "Git Providers" ,
88
93
link : [ `/settings/git` ] ,
89
94
} ) ;
90
95
}
91
- if ( billingMode ?. mode !== "none" ) {
96
+ if ( isOwner && billingMode ?. mode !== "none" ) {
92
97
// The Billing page handles billing mode itself, so: always show it!
93
98
result . push ( {
94
99
title : "Billing" ,
0 commit comments