0

I need to get approve , edit and read permissions for a site .How can i find this?

1

Use EffectiveBasePermissions to get permissions of the user. Example:

_spPageContextInfo.webAbsoluteUrl +"/_api/Web/effectiveBasePermissions"

In any case the end result is high and low permission masks use SP.BasePermissions().has as can be seen in below example:

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

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

    var manageLists = managePerms.has(SP.PermissionKind.manageLists);
    var manageGroup = managePerms.has(SP.PermissionKind.createGroups);
    var manageWeb = managePerms.has(SP.PermissionKind.manageWeb);
    alert("Manage Lists: " + manageLists);
    alert("Manage Group: " + manageGroup);
    alert("Manage Web: " + manageWeb);        
});
}
0

Try ajax call with URL format as https://yoursite/_api/web/roleassignments/getbyprincipalid(userid)/roledefinitionbindings

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.