Merge pull request #55 from wimvelzeboer/feature/addStripInaccessibleFieldsMethodToDomain

Add stripInaccessibleFields method to the domain.
This commit is contained in:
William Velzeboer
2024-01-19 11:56:03 +00:00
committed by GitHub
@@ -286,6 +286,26 @@ public virtual class fflib_SObjects2
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
*