Add stripInaccessibleFields method to the domain.

This commit is contained in:
Wim Velzeboer
2024-01-19 11:48:44 +00:00
parent 31967fafad
commit 97e825d068
@@ -286,6 +286,26 @@ public virtual class fflib_SObjects2
return result; return result;
} }
/**
* @return Trip the records from fields that the user doesn't have access to
*/
public virtual List<SObject> stripInaccessibleFields()
{
return stripInaccessibleFields(AccessType.READABLE);
}
/**
* @param accessType
*
* @return Trip the records from fields that the user doesn't have access to
*/
public virtual List<SObject> stripInaccessibleFields(
System.AccessType accessType
)
{
return Security.stripInaccessible(accessType, getRecords()).getRecords();
}
/** /**
* @param sObjectField The Schema.SObjectField to get their Id values * @param sObjectField The Schema.SObjectField to get their Id values
* *