From 6953fcf6b55d2bec6286fa1657ca60c33977d79a Mon Sep 17 00:00:00 2001 From: Pablo Lara Date: Tue, 14 Jan 2025 10:23:23 +0100 Subject: [PATCH] chore(rbac): tweaks role permissions (#6496) --- ui/components/roles/workflow/forms/add-role-form.tsx | 11 ++++++++--- ui/components/roles/workflow/forms/edit-role-form.tsx | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ui/components/roles/workflow/forms/add-role-form.tsx b/ui/components/roles/workflow/forms/add-role-form.tsx index 92c62c6d21..681e658657 100644 --- a/ui/components/roles/workflow/forms/add-role-form.tsx +++ b/ui/components/roles/workflow/forms/add-role-form.tsx @@ -136,10 +136,15 @@ export const AddRoleForm = ({ const permissions = [ { field: "manage_users", label: "Invite and Manage Users" }, - { field: "manage_account", label: "Manage Account" }, - { field: "manage_billing", label: "Manage Billing" }, + ...(process.env.NEXT_PUBLIC_IS_CLOUD_ENV === "true" + ? [ + { field: "manage_account", label: "Manage Account" }, + { field: "manage_billing", label: "Manage Billing" }, + ] + : []), { field: "manage_providers", label: "Manage Cloud Providers" }, - { field: "manage_integrations", label: "Manage Integrations" }, + // TODO: Add back when we have integrations ready + // { field: "manage_integrations", label: "Manage Integrations" }, { field: "manage_scans", label: "Manage Scans" }, { field: "unlimited_visibility", label: "Unlimited Visibility" }, ]; diff --git a/ui/components/roles/workflow/forms/edit-role-form.tsx b/ui/components/roles/workflow/forms/edit-role-form.tsx index d837cbe3cd..e47c62be3d 100644 --- a/ui/components/roles/workflow/forms/edit-role-form.tsx +++ b/ui/components/roles/workflow/forms/edit-role-form.tsx @@ -159,10 +159,15 @@ export const EditRoleForm = ({ const permissions = [ { field: "manage_users", label: "Invite and Manage Users" }, - { field: "manage_account", label: "Manage Account" }, - { field: "manage_billing", label: "Manage Billing" }, + ...(process.env.NEXT_PUBLIC_IS_CLOUD_ENV === "true" + ? [ + { field: "manage_account", label: "Manage Account" }, + { field: "manage_billing", label: "Manage Billing" }, + ] + : []), { field: "manage_providers", label: "Manage Cloud Providers" }, - { field: "manage_integrations", label: "Manage Integrations" }, + // TODO: Add back when we have integrations ready + // { field: "manage_integrations", label: "Manage Integrations" }, { field: "manage_scans", label: "Manage Scans" }, { field: "unlimited_visibility", label: "Unlimited Visibility" }, ];