0

I'm querying items from a SharePoint 2013 list via JavaScript / JSOM. The JavaScript is running on a SharePoint 2013 website (not necessarily the same as the one, containing the list, but in the same farm).

Now I want to check if the current user has the rights to create/edit items in said list. How can I do this using JSOM or the SharePoint REST services.

Hinek
  • 9,519
  • 12
  • 52
  • 74
  • Oh, I just found an article on this ... I will try it and tell if it works: http://www.lifeonplanetgroove.com/checking-user-permissions-from-the-sharepoint-2013-rest-api/ – Hinek Jan 22 '15 at 14:52

1 Answers1

0

Found my answer here: https://sharepoint.stackexchange.com/a/129311/400

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

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

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

        var message = jQuery("#message");
        message.text("Manage Lists: " + manageLists);
    });
}
Community
  • 1
  • 1
Hinek
  • 9,519
  • 12
  • 52
  • 74