You need to sign in to do that
Don't have an account?
chaithaly gowda
Security enforced on SOQL
Hi
I have applied stripInaccessible in the following query,
SObjectAccessDecision securityDecision = Security.stripInaccessible(AccessType.READABLE,[SELECT Id, Name, IsActive, , ProfileId, UserRoleId,UserRole.Name, Profile.Name,
FROM User WHERE Id =: pUserId LIMIT 1]);
System.debug('Fields removed by stripInaccessible: '+securityDecision.getRemovedFields());
In the debug statement I can see Profile.Name and ProfileId are getting stripped. I am not sure check/give the permission to 'Profile Object /Fields. I dont find 'Set FLS ' in fields as well.
Any help is appreciated.
Thanks
.
I have applied stripInaccessible in the following query,
SObjectAccessDecision securityDecision = Security.stripInaccessible(AccessType.READABLE,[SELECT Id, Name, IsActive, , ProfileId, UserRoleId,UserRole.Name, Profile.Name,
FROM User WHERE Id =: pUserId LIMIT 1]);
System.debug('Fields removed by stripInaccessible: '+securityDecision.getRemovedFields());
In the debug statement I can see Profile.Name and ProfileId are getting stripped. I am not sure check/give the permission to 'Profile Object /Fields. I dont find 'Set FLS ' in fields as well.
Any help is appreciated.
Thanks
.
I ran the same in my org as a System Admin and the debug does not show anything.
Can you clarify if you are running as admin in your org?
Checked related: https://newstechnologystuff.com/2020/04/08/enforce-security-with-the-stripinaccessible-method/
https://www.apexhours.com/security-in-salesforce/
Thanks