SalesforceCommerceCloud / b2c-crm-sync

... a contemporary perspective on how to integrate B2C Commerce and the Salesforce Customer 360 Platform to power frictionless customer experiences in the B2C domain.
https://salesforcecommercecloud.github.io/b2c-crm-sync/
BSD 3-Clause "New" or "Revised" License
65 stars 45 forks source link

[BUG] ... CRUD condition in B2CConfigurationManager.cls #210

Closed mzaklama closed 1 year ago

mzaklama commented 1 year ago

Describe the bug In force-app/main/default/classes/B2CConfigurationManager.cls Method: getPersonAccountRecordTypeDeveloperName() Line: 97

The condition checks that the current User has the correct CRUD access. But it should be negated.

Current Logic: IF user has all CRUD access return NULL ELSE do the SOQL query

`if ( // Validate that we have CRUD permissions to access this data B2C_CRM_Sync_Default_Configurationmdt.SObjectType.getDescribe().isAccessible() && Schema.SObjectType.B2C_CRM_Sync_Default_Configurationmdt.fields.DeveloperName.isAccessible() && B2C_CRMSync_Settingmdt.SObjectType.getDescribe().isAccessible() && Schema.SObjectType.B2C_CRMSync_Settingmdt.fields.PersonAccount_Record_Type_Developername__c.isAccessible() ) { return null; }

// Get the default configuration profile B2C_CRM_Sync_Default_Configurationmdt configurationProfile = [ SELECT Active_Configuration__r.PersonAccount_Record_Type_Developernamec FROM B2C_CRM_Sync_Default_Configuration__mdt WHERE DeveloperName = 'Production_Configuration' LIMIT 1 ];

// Set the output variable to contain the specified configuration property return configurationProfile.Active_Configuration__r.PersonAccount_Record_Type_Developername__c;`

jbachelet commented 1 year ago

This has been fixed in #213