Skip to content

Commit 03262da

Browse files
committed
fixup
1 parent 2c6c5d1 commit 03262da

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

components/dashboard/src/teams/OrgSettingsPage.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export function OrgSettingsPage({ children }: OrgSettingsPageProps) {
3232
billingMode: orgBillingMode.data,
3333
ssoEnabled: oidcServiceEnabled,
3434
orgGitAuthProviders,
35+
isOwner: org.data?.isOwner,
3536
}),
3637
[org.data, orgBillingMode.data, oidcServiceEnabled, orgGitAuthProviders],
3738
);
@@ -51,8 +52,11 @@ export function OrgSettingsPage({ children }: OrgSettingsPageProps) {
5152
);
5253
}
5354

55+
// TODO: redirect when current page is not included in menu
56+
const onlyForOwner = false;
57+
5458
// After we've loaded, ensure user is an owner, if not, redirect
55-
if (!org.data?.isOwner) {
59+
if (onlyForOwner && !org.data?.isOwner) {
5660
return <Redirect to={"/"} />;
5761
}
5862

@@ -68,27 +72,28 @@ function getTeamSettingsMenu(params: {
6872
billingMode?: BillingMode;
6973
ssoEnabled?: boolean;
7074
orgGitAuthProviders: boolean;
75+
isOwner?: boolean;
7176
}) {
72-
const { billingMode, ssoEnabled, orgGitAuthProviders } = params;
77+
const { billingMode, ssoEnabled, orgGitAuthProviders, isOwner } = params;
7378
const result = [
7479
{
7580
title: "General",
7681
link: [`/settings`],
7782
},
7883
];
79-
if (ssoEnabled) {
84+
if (isOwner && ssoEnabled) {
8085
result.push({
8186
title: "SSO",
8287
link: [`/sso`],
8388
});
8489
}
85-
if (orgGitAuthProviders) {
90+
if (isOwner && orgGitAuthProviders) {
8691
result.push({
8792
title: "Git Providers",
8893
link: [`/settings/git`],
8994
});
9095
}
91-
if (billingMode?.mode !== "none") {
96+
if (isOwner && billingMode?.mode !== "none") {
9297
// The Billing page handles billing mode itself, so: always show it!
9398
result.push({
9499
title: "Billing",

0 commit comments

Comments
 (0)