mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-24 13:01:56 +00:00
fix(RBAC): restore manage_account permission for roles (#6602)
This commit is contained in:
@@ -90,6 +90,7 @@ export const addRole = async (formData: FormData) => {
|
||||
manage_users: formData.get("manage_users") === "true",
|
||||
manage_providers: formData.get("manage_providers") === "true",
|
||||
manage_scans: formData.get("manage_scans") === "true",
|
||||
manage_account: formData.get("manage_account") === "true",
|
||||
// TODO: Add back when we have integrations ready
|
||||
// manage_integrations: formData.get("manage_integrations") === "true",
|
||||
unlimited_visibility: formData.get("unlimited_visibility") === "true",
|
||||
@@ -98,10 +99,8 @@ export const addRole = async (formData: FormData) => {
|
||||
},
|
||||
};
|
||||
|
||||
// Conditionally include manage_account and manage_billing for cloud environment
|
||||
// Conditionally include manage_billing for cloud environment
|
||||
if (process.env.NEXT_PUBLIC_IS_CLOUD_ENV === "true") {
|
||||
payload.data.attributes.manage_account =
|
||||
formData.get("manage_account") === "true";
|
||||
payload.data.attributes.manage_billing =
|
||||
formData.get("manage_billing") === "true";
|
||||
}
|
||||
@@ -157,6 +156,7 @@ export const updateRole = async (formData: FormData, roleId: string) => {
|
||||
...(name && { name }), // Include name only if provided
|
||||
manage_users: formData.get("manage_users") === "true",
|
||||
manage_providers: formData.get("manage_providers") === "true",
|
||||
manage_account: formData.get("manage_account") === "true",
|
||||
manage_scans: formData.get("manage_scans") === "true",
|
||||
// TODO: Add back when we have integrations ready
|
||||
// manage_integrations: formData.get("manage_integrations") === "true",
|
||||
@@ -166,10 +166,8 @@ export const updateRole = async (formData: FormData, roleId: string) => {
|
||||
},
|
||||
};
|
||||
|
||||
// Conditionally include manage_account and manage_billing for cloud environments
|
||||
// Conditionally include manage_billing for cloud environments
|
||||
if (process.env.NEXT_PUBLIC_IS_CLOUD_ENV === "true") {
|
||||
payload.data.attributes.manage_account =
|
||||
formData.get("manage_account") === "true";
|
||||
payload.data.attributes.manage_billing =
|
||||
formData.get("manage_billing") === "true";
|
||||
}
|
||||
|
||||
@@ -38,7 +38,6 @@ export const AddRoleForm = ({
|
||||
unlimited_visibility: false,
|
||||
groups: [],
|
||||
...(process.env.NEXT_PUBLIC_IS_CLOUD_ENV === "true" && {
|
||||
manage_account: false,
|
||||
manage_billing: false,
|
||||
}),
|
||||
},
|
||||
@@ -85,6 +84,7 @@ export const AddRoleForm = ({
|
||||
formData.append("manage_users", String(values.manage_users));
|
||||
formData.append("manage_providers", String(values.manage_providers));
|
||||
formData.append("manage_scans", String(values.manage_scans));
|
||||
formData.append("manage_account", String(values.manage_account));
|
||||
formData.append(
|
||||
"unlimited_visibility",
|
||||
String(values.unlimited_visibility),
|
||||
@@ -92,7 +92,6 @@ export const AddRoleForm = ({
|
||||
|
||||
// Conditionally append manage_account and manage_billing
|
||||
if (process.env.NEXT_PUBLIC_IS_CLOUD_ENV === "true") {
|
||||
formData.append("manage_account", String(values.manage_account));
|
||||
formData.append("manage_billing", String(values.manage_billing));
|
||||
}
|
||||
|
||||
@@ -142,12 +141,10 @@ export const AddRoleForm = ({
|
||||
const permissions = [
|
||||
{ field: "manage_users", label: "Invite and Manage Users" },
|
||||
...(process.env.NEXT_PUBLIC_IS_CLOUD_ENV === "true"
|
||||
? [
|
||||
{ field: "manage_account", label: "Manage Account" },
|
||||
{ field: "manage_billing", label: "Manage Billing" },
|
||||
]
|
||||
? [{ field: "manage_billing", label: "Manage Billing" }]
|
||||
: []),
|
||||
{ field: "manage_providers", label: "Manage Cloud Providers" },
|
||||
{ field: "manage_account", label: "Manage Account" },
|
||||
// TODO: Add back when we have integrations ready
|
||||
// { field: "manage_integrations", label: "Manage Integrations" },
|
||||
{ field: "manage_scans", label: "Manage Scans" },
|
||||
|
||||
@@ -96,12 +96,12 @@ export const EditRoleForm = ({
|
||||
|
||||
updatedFields.manage_users = values.manage_users;
|
||||
updatedFields.manage_providers = values.manage_providers;
|
||||
updatedFields.manage_account = values.manage_account;
|
||||
// updatedFields.manage_integrations = values.manage_integrations;
|
||||
updatedFields.manage_scans = values.manage_scans;
|
||||
updatedFields.unlimited_visibility = values.unlimited_visibility;
|
||||
|
||||
if (process.env.NEXT_PUBLIC_IS_CLOUD_ENV === "true") {
|
||||
updatedFields.manage_account = values.manage_account;
|
||||
updatedFields.manage_billing = values.manage_billing;
|
||||
}
|
||||
|
||||
@@ -165,11 +165,9 @@ export const EditRoleForm = ({
|
||||
const permissions = [
|
||||
{ field: "manage_users", label: "Invite and Manage Users" },
|
||||
...(process.env.NEXT_PUBLIC_IS_CLOUD_ENV === "true"
|
||||
? [
|
||||
{ field: "manage_account", label: "Manage Account" },
|
||||
{ field: "manage_billing", label: "Manage Billing" },
|
||||
]
|
||||
? [{ field: "manage_billing", label: "Manage Billing" }]
|
||||
: []),
|
||||
{ field: "manage_account", label: "Manage Account" },
|
||||
{ field: "manage_providers", label: "Manage Cloud Providers" },
|
||||
// TODO: Add back when we have integrations ready
|
||||
// { field: "manage_integrations", label: "Manage Integrations" },
|
||||
|
||||
Reference in New Issue
Block a user