From 2a52463585f28f687c2d017c7fa5b9147191815f Mon Sep 17 00:00:00 2001 From: Carlos Monastyrski Date: Thu, 28 Aug 2025 20:47:10 -0300 Subject: [PATCH] Improve Audit Log Org Permission Label --- .../OrgPermissionAuditLogsRow.tsx | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/frontend/src/pages/organization/RoleByIDPage/components/RolePermissionsSection/OrgPermissionAuditLogsRow.tsx b/frontend/src/pages/organization/RoleByIDPage/components/RolePermissionsSection/OrgPermissionAuditLogsRow.tsx index 82c4966b9..d7d523b53 100644 --- a/frontend/src/pages/organization/RoleByIDPage/components/RolePermissionsSection/OrgPermissionAuditLogsRow.tsx +++ b/frontend/src/pages/organization/RoleByIDPage/components/RolePermissionsSection/OrgPermissionAuditLogsRow.tsx @@ -18,8 +18,6 @@ type Props = { enum Permission { NoAccess = "no-access", - ReadOnly = "read-only", - FullAccess = "full-access", Custom = "custom" } @@ -41,13 +39,10 @@ export const OrgPermissionAuditLogsRow = ({ isEditable, control, setValue }: Pro const selectedPermissionCategory = useMemo(() => { const actions = Object.keys(rule || {}) as Array; - const totalActions = PERMISSION_ACTIONS.length; const score = actions.map((key) => (rule?.[key] ? 1 : 0)).reduce((a, b) => a + b, 0 as number); if (isCustom) return Permission.Custom; if (score === 0) return Permission.NoAccess; - if (score === totalActions) return Permission.FullAccess; - if (score === 1 && rule?.[OrgPermissionAuditLogsActions.Read]) return Permission.ReadOnly; return Permission.Custom; }, [rule, isCustom]); @@ -74,18 +69,6 @@ export const OrgPermissionAuditLogsRow = ({ isEditable, control, setValue }: Pro setIsCustom.off(); switch (val) { - case Permission.FullAccess: - case Permission.ReadOnly: - // For audit logs, both full access and read-only are the same - just read access - setValue( - "permissions.audit-logs", - { - [OrgPermissionAuditLogsActions.Read]: true - }, - { shouldDirty: true } - ); - break; - case Permission.NoAccess: default: setValue( @@ -118,8 +101,6 @@ export const OrgPermissionAuditLogsRow = ({ isEditable, control, setValue }: Pro position="popper" > No Access - Read Only - Full Access Custom