Quantcast
Channel: jQuery Library for SharePoint Web Services
Viewing all articles
Browse latest Browse all 6517

New Post: AddPermission to folder

$
0
0
So I've figured out how to add folders and sub-folders, and copy files into them using UpdateListItems and CopyIntoItemsLocal.

What I need to do now is set up some custom permissions on the folders and files.

I put together a function as below but for some reason I'm getting error for status, undefined for the xml, and the error log in firebug is showing me "NetworkError: 500 Internal Server Error - https://mydomain/mysite/mysubsite/submissions/_vti_bin/Permissions.asmx"
    function makecontributor(folder,user) {
        $().SPServices({
            operation: 'AddPermission',
            async: false, 
            objectType: 'List',
            objectName: folder,
            permissionIdentifier: user,
            permissionType: 'user',
            permissionMask: 1011028719,
            completefunc: function(xData, Status) {
                document.getElementById("usernames").value += ('  --Setting permission on '+folder+' for '+user+' to '+"\n");
                document.getElementById("usernames").value += ('  --Status=' + Status + " XML=" + xData.responseXML.xml+"\n");      
            }
        });
    }

Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>