Skip to content

Commit fae59b8

Browse files
author
Reinier van den Assum
committed
fflib_SObjectDomain.cls: Corrected logic for CRUD Security check on Undelete
* Potential regression impact when someone implemented an Undelete Trigger using the fflib_SObjectDomain, enforcing CRUD, but the running user has Create and no Undelete permission
1 parent 7cc5341 commit fae59b8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sfdx-source/apex-common/main/classes/fflib_SObjectDomain.cls

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ public virtual with sharing class fflib_SObjectDomain
269269
**/
270270
public virtual void handleAfterUndelete()
271271
{
272-
if(Configuration.EnforcingTriggerCRUDSecurity && !SObjectDescribe.isCreateable())
273-
throw new DomainException('Permission to create an ' + SObjectDescribe.getName() + ' denied.');
272+
if(Configuration.EnforcingTriggerCRUDSecurity && !SObjectDescribe.isUndeletable())
273+
throw new DomainException('Permission to undelete an ' + SObjectDescribe.getName() + ' denied.');
274274

275275
onAfterUndelete();
276276
}

0 commit comments

Comments
 (0)