2

I am attempting to query a list using CAML via JSOM and am getting the error message The method "GetItems" of the type "List" with id "{GUID}" is blocked by the administrator on the server. I have set the web application for anonymous, the site for anonymous use, and have checked that anonymous users have View permissions on the list, but I continue to get this error message. I have verified my CAML is correct because I get the correct return values when running under an authenticated user. I have come across some sources that say to toggle off Require Use Remote Interfaces Permission, but that didn't resolve my problem either. Any suggestions?

4
  • 1
    Did you add permission for the levels "Use Client Integration Features" and "Remote Interfaces"?
    – eirikb
    Feb 12, 2015 at 9:36
  • No, where might I find those settings? In CA?
    – KidBatman
    Feb 13, 2015 at 6:14
  • Site settings -> Site permission -> Permission levels
    – eirikb
    Feb 13, 2015 at 7:53
  • Created a site permission level with the levels you suggested, but how do I assign them to Anonymous User? Looks like permissions for anon are restricted to a checkbox of CRUD actions.
    – KidBatman
    Feb 13, 2015 at 8:50

2 Answers 2

1

In On Premise environment, we can disable the “Require Use Remote Interfaces permission” to let anonymous users access Client Object Model in Central Administration.

If it is an Online environment, you can use SP.Site.updateClientObjectModelUseRemoteAPIsPermissionSetting Method to do the trick.

 <script type="text/javascript">
ExecuteOrDelayUntilScriptLoaded(function() {
   var ctx = new SP.ClientContext();
   var site = ctx.get_site();
   site.updateClientObjectModelUseRemoteAPIsPermissionSetting(false);
   ctx.executeQueryAsync(
      function() { alert('success') },
      function() { alert('error') }
   );
}, 'sp.js');
</script>
1
  • Just tried the suggested solution and receive Access denied. You do not have permission to perform this action or access this resource. from my callback fail method. Thoughts?
    – KidBatman
    Feb 13, 2015 at 6:20
0

I found a solution to my problem here. You have to remove the GetItems function from the AnonymousRestrictedTypes via powershell. Hope this helps others with this issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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