From 3caa07ef332e262c845085d27ccbe1e63417621a Mon Sep 17 00:00:00 2001 From: Reede Stockton Date: Wed, 10 Jan 2024 12:49:52 -0800 Subject: [PATCH] Remove unnecessary security check. --- .../classes/GE_GiftEntryController.cls | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/force-app/main/default/classes/GE_GiftEntryController.cls b/force-app/main/default/classes/GE_GiftEntryController.cls index 7c75f999975..6353ce42e4f 100644 --- a/force-app/main/default/classes/GE_GiftEntryController.cls +++ b/force-app/main/default/classes/GE_GiftEntryController.cls @@ -426,13 +426,6 @@ public with sharing class GE_GiftEntryController { DataImport__c dataImportObject = (DataImport__c)JSON.deserialize(dataImport, DataImport__c.class); try { - // As currently implemented, Gift Entry already checks everything checked in canUpsertDataImport() before - // allowing access. As a result, canUpsertDataImport() should never return false. It is implemented solely - // as a defense against future modifications since it is an AuraEnabled method that could be used outside - // of the currently implemented flow. - if (!canUpsertDataImport(dataImportObject)) { - throw new UTIL_Permissions.InsufficientPermissionException(System.Label.commonAccessErrorMessage); - } upsert dataImportObject Id; return dataImportObject; @@ -445,23 +438,6 @@ public with sharing class GE_GiftEntryController { } } - private static Boolean canUpsertDataImport(DataImport__c dataImportObject) { - if (!UTIL_Permissions.canCreate(UTIL_Namespace.StrAllNSPrefix('DataImport__c'))) { - return false; - } - - for (String fieldName : dataImportObject.getPopulatedFieldsAsMap().keySet()) { - if (!UTIL_Permissions.canUpdate(UTIL_Namespace.StrAllNSPrefix('DataImport__c'), - UTIL_Namespace.StrAllNSPrefix(fieldName), false)) { - if (!fieldName.equalsIgnoreCase('Id')) { - return false; - } - } - } - - return true; - } - /******************************************************************************************************* * @description Run the DataImport process on a single gift * @param dataImport DataImport record to be processed