2

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.

  • What is the access level on the Static Resource. Public/Private? – Hemant Jain Sep 29 '17 at 12:26
  • the access level is public – Saravanan Baskar Sep 29 '17 at 14:50
2

Accessing Static Resources requires the "View and setup configuration" permission.

View more details about managing static resources and required permission to do same @ https://help.salesforce.com/articleView?id=pages_static_resources_manage.htm&type=5

  • This answer can be improved by a link / source. – Pranay Jaiswal Jul 23 '18 at 13:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.