You need to sign in to do that
Don't have an account?
robert webber 8
Use of stripInaccessible in Security Reviews
Can you use the new stripInaccessible to avoid all the individual field checks requried to pass the security review, like shown below? This has always been a big hassle. If so, can someone give me an example?
Thanks
List<String> checkFields3 = new List<String> {'ProjectionDate__c','InvestmentPlanID__c','InvestmentID__c','CombineResources__c'};
Map<String,Schema.sObjectField> m3 = Schema.SObjectType.Investment_Summary_Data__c.Fields.getMap();
for(String f:checkFields3) {
if(!m3.get(npPfx+f).getDescribe().isCreateable() || !m3.get(npPfx+f).getDescribe().isUpdateable()) {
'+m3.get(npPfx+f).getDescribe().isCreateable());
throw new MyException('Contact administrator - you do not have permission to create Investment Summary Data');
}
} //end fls create check
Thanks
List<String> checkFields3 = new List<String> {'ProjectionDate__c','InvestmentPlanID__c','InvestmentID__c','CombineResources__c'};
Map<String,Schema.sObjectField> m3 = Schema.SObjectType.Investment_Summary_Data__c.Fields.getMap();
for(String f:checkFields3) {
if(!m3.get(npPfx+f).getDescribe().isCreateable() || !m3.get(npPfx+f).getDescribe().isUpdateable()) {
'+m3.get(npPfx+f).getDescribe().isCreateable());
throw new MyException('Contact administrator - you do not have permission to create Investment Summary Data');
}
} //end fls create check
The example is provided in the below blog (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_with_security_stripInaccessible.htm#:~:text=Custom%20Settings-,Enforce%20Security%20With%20the%20stripInaccessible%20Method,the%20user%20can't%20access.).
I hope you find the above information is helpful. If it does, please mark as Best Answer to help others too.
Thanks.
All Answers
The example is provided in the below blog (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_with_security_stripInaccessible.htm#:~:text=Custom%20Settings-,Enforce%20Security%20With%20the%20stripInaccessible%20Method,the%20user%20can't%20access.).
I hope you find the above information is helpful. If it does, please mark as Best Answer to help others too.
Thanks.