Unable to access static resources for some profiles who doesn't have view and setup configuration. I have a xml file in my static resources we query that static resources and do the processing with that xml in my app. Unfortunately the users who doesn't have access to view and setup configuration are unable to access that static resource via soql(fields are not accessible). I don't find any options to provide permissions to the profile do we have any setting where I could enable access for the profile instead of enabling view and setup configuration??
if(Schema.sObjectType.StaticResource.fields.body.IsAccessible()){ // Fails for profile whose "view and setup configuration" has been turned off
StaticResource xml = [select body from StaticResource where name = 'somedata'];
}
Is this the expected behavior? To access staticresources from apex do the profile require view and setup configuration access.
Note: Im able to get the static resource from the browser for the same profile.