This project has moved and is read-only. For the latest updates, please go here.

Converting permissions request to Promises

Apr 25, 2013 at 4:14 PM
I have a nice application that returns some good information about permissions on a list. In trying to convert it to the Promises version, it fails in a way I don't understand.
    $(document).ready(function() {

        var listPromise = $().SPServices({
         operation: "GetPermissionCollection",
         objectName: '{0322FE3F-D1F3-40D1-BFCD-AAC2DB369D7E}',
         objectType: "List"     //only two values: List, Web
        listPromise.done(function() {
        }); //listPromise.done {
            alert("Error getting permissions collection...");

    }); // $(document).ready
The code fails at the .done() clause, not finding an object (presumably, listPromise). The alert does not display.

See anything wrong?
Apr 26, 2013 at 4:33 PM

I just did something stupid and got the same error. The stupid thing I did was to try to test your script in a site that was still loading v0.7.2. Any chance that's what's happening?

Apr 26, 2013 at 4:35 PM
p.s. It seems to run fine in a site that's loading 2013.01ALPHA7.

Apr 26, 2013 at 5:28 PM
Well, it now works for me, too. Actually, I've been using ALPHA7 even for non-Promise code. But I created a test that duplicates what I've posted here, and it works just fine.

I just finished a nice piece of code that presents a list of all folks who have rights to a web or list (together with those rights), so I'll try converting that.

Thanks for the test...