0

I am trying to list all users/groups who has access to folder inside library. Code below which I tried works fine for library/list itself but not for (sub)folder. My guess is that it is not possible to do such a thing using frontend+javascript+SPServices solution. Could anyone confirm or help providing any solution?

(Main part of) Code tried for library which works fine:

   $().SPServices
    ({
        webURL: tempURL_valid_to_SP_Site,
        operation: "GetPermissionCollection",
        async: false,
        objectName: "LibraryNameHere", //I tried something like "listname\\folder" but it does not work
        objectType: "List", //I tried "Folder" here but not working
        completefunc: function (xData, Status) {
            console.log($(xData.responseXML));

            $(xData.responseXML).find("Permission").each(function () {
                console.log($(this));
                var xmlGroupName = $(this).attr("GroupName");
                var strGroupName = String(xmlGroupName);
                var strUserName = String($(this).attr("UserName"));
                var strMemberIsUser = String($(this).attr("MemberIsUser"));



                var xmlUserLogin = $(this).attr("UserLogin");
                var strUserLogin = String(xmlUserLogin);
                var xmlmask = $(this).attr("Mask");
                var mask = String(xmlmask);
                if (inDebug) {
                    //console.log('Group Name ' + strGroupName + ' Mask Is ' + mask);
                    $scope.results.push('Group Name ' + strGroupName
                        + ' | ' + strUserName
                        + ' | ' + strMemberIsUser
                        + ' | ' + strUserLogin
                        + ' | Mask Is ' + mask);
                }


            });
        }
    });

Your Answer

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

Browse other questions tagged or ask your own question.