Skip to content

Commit 88e3720

Browse files
committed
feedback
1 parent aeb6711 commit 88e3720

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

site/e2e/tests/roles.spec.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ const adminSettings = [
2323

2424
async function hasAccessToAdminSettings(page: Page, settings: AdminSetting[]) {
2525
// Organizations and Audit Logs both require a license to be visible
26-
const visibleSettings = settings.filter(
27-
(it) => Boolean(license) || (it !== "Organizations" && it !== "Audit Logs"),
28-
);
26+
const visibleSettings = license
27+
? settings
28+
: settings.filter((it) => it !== "Organizations" && it !== "Audit Logs");
2929
const adminSettingsButton = page.getByRole("button", {
3030
name: "Admin settings",
3131
});

site/src/contexts/auth/permissions.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ export const canViewDeploymentSettings = (
180180
permissions !== undefined &&
181181
(permissions.viewDeploymentValues ||
182182
permissions.viewAllLicenses ||
183-
permissions.viewDeploymentValues ||
184183
permissions.viewAllUsers ||
185184
permissions.viewAnyGroup ||
186185
permissions.viewNotificationTemplate ||

site/src/modules/management/DeploymentSettingsLayout.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ const DeploymentSettingsLayout: FC = () => {
1717
const { permissions } = useAuthenticated();
1818
const location = useLocation();
1919

20-
// The deployment settings page also contains users and groups and more so
21-
// this page must be visible if you can see any of these.
22-
const canViewDeploymentSettingsPage = canViewDeploymentSettings(permissions);
23-
2420
if (location.pathname === "/deployment") {
2521
return (
2622
<Navigate
@@ -34,6 +30,10 @@ const DeploymentSettingsLayout: FC = () => {
3430
);
3531
}
3632

33+
// The deployment settings page also contains users and groups and more so
34+
// this page must be visible if you can see any of these.
35+
const canViewDeploymentSettingsPage = canViewDeploymentSettings(permissions);
36+
3737
return (
3838
<RequirePermission isFeatureVisible={canViewDeploymentSettingsPage}>
3939
<div>

0 commit comments

Comments
 (0)