0

I want to know user's permission on SharePoint site with REST API. Could anyone please help me to generate the REST query which will give me user's permission on the site. I don't want to know permission of the current user. My module contains people picker field in which I will take input from username ( a user whose permission is to be check) and in other text box user will enter url or name of the site. So I want to check the permission of entered user on entered site. Your help is appreciated. Thank you.

0

You cannot check directly, alternate is to use effectiveBasePermissions for diffrent masks.

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);
    });
}

Ref link

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.