I followed codes sample here with security trim to get a list of sub site titles that user have access.

I got

Access denied. You do not have permission to perform or access this resource.

Is there a solution for this? The users have read-only at the root site and contribute at subside.

Below is the codes:


2 Answers 2


If i run this as a Visitor on my root site I get

Access denied. You do not have permission to perform this action or access this resource.

as well. So it is safe to assume that you need a higher permission to call this method.

I'd say that you need at least manageWeb permission to run it.


"Webs" (whether in CSOM, REST APIs or server side code) always requires manageweb to run.

A possible solution might be to use the search API to list items of site type. For instance, a call like this:


would display webs. You would need to filter on the "ParentLink" property to get webs from a particular web.

The advantage of this is that it is security trimmed, so the user will only see what they have permission to see.

Your Answer

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

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