Skip to content

Commit 5e008f5

Browse files
Improved output of inaccessible fields on security violation
1 parent 62b2089 commit 5e008f5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

framework/default/ortoo-core/default/classes/fflib-extension/SecureDml.cls

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,8 +617,9 @@ public inherited sharing virtual class SecureDml extends fflib_SobjectUnitOfWork
617617
String label = Label.ortoo_core_fls_violation;
618618
String modeDescription = descriptionByMode.get( mode );
619619
String sobjectTypeName = SobjectUtils.getSobjectName( sobjectType );
620+
String fieldsInViolationString = String.join( ListUtils.convertToListOfStrings( fieldsInViolation ), ', ' );
620621

621-
throw new SecureDmlException( StringUtils.formatLabel( label, new List<String>{ modeDescription, sobjectTypeName, fieldsInViolation.toString() } ) )
622+
throw new SecureDmlException( StringUtils.formatLabel( label, new List<String>{ modeDescription, sobjectTypeName, fieldsInViolationString } ) )
622623
.setErrorCode( FrameworkErrorCodes.DML_ON_INACCESSIBLE_FIELDS )
623624
.addContext( 'sobjectTypeName', sobjectTypeName )
624625
.addContext( 'fieldsInViolation', fieldsInViolation )

framework/default/ortoo-core/default/labels/ortoo-core-CustomLabels.labels-meta.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<language>en_US</language>
3434
<protected>false</protected>
3535
<shortDescription>Message when FLS violation occurs on a DML operation.</shortDescription>
36-
<value>Attempted to {0} {1} with fields that are not accessible: {2}</value>
36+
<value>Attempted to {0} {1} with fields that are not accessible / updateable: {2}</value>
3737
</labels>
3838
<labels>
3939
<fullName>ortoo_core_crud_insert_violation</fullName>

0 commit comments

Comments
 (0)