I have a site collection in share point online. Its has some lists and sub sites. Again the sub sites having some lists. Some sub sites and lists having unique permissions and some have inheritance permissions . I need to check whether the current login having permission level Approve for any lists in all the sub sites and lists using rest api. Actually i am looking for a function(sample code) which iterate the sites collection lists and sub sites lists for checking the Approve permission level for the lists. i am using /_api/site/rootWeb/webinfos to get the sub sites ServerRelativeUrl .

Can anyone help me please. Thanks in Advance

2 Answers 2


I don't have a ready made sample for your but here is a good starting sample to iterate all subsite: Most efficient way to get all sub sites under a site collection/sub site using JSOM?

Try extending the script at after "var web = webs.getItemAtIndex(i);" to query the site for it's lists and include in the load whether the list HasUniquePermissions en the Roleassignments.


Please check below sample code for get permission of current user in particular list.

function checkPermissions() {
    var call = jQuery.ajax({
        url: _spPageContextInfo.webAbsoluteUrl +
        type: "GET",
        dataType: "json",
        headers: {
            Accept: "application/json;odata=verbose"

call.done(function (data, textStatus, jqXHR) {
    var manageListsPerms = new SP.BasePermissions();

    var manageLists = manageListsPerms.has(SP.PermissionKind.ApproveItems);

    var message = jQuery("#message");
    message.text("Approve ListItem: " + manageLists);


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.