I have created a Custom list named Test List. I need to check whether the current user is having edit list permission for Test List list or not, by using JSOM.


You can try using below code. Since its OnPrem, we first need to get the login name of user and pass it to the get_effectiveBasePermissions method.

To ensure that user has edit permission, we will check the SP.PermissionKind.editListItems enum.

SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function () {

function getCurrentUserPermission()
    var web,clientContext,currentUser,oList,perMask;

    clientContext = new SP.ClientContext.get_current();
    web = clientContext.get_web();
    currentUser = web.get_currentUser();   
    oList = web.get_lists().getByTitle('Test List');

        if (oList.get_effectiveBasePermissions().has(SP.PermissionKind.editListItems)){
            console.log("user has edit permission");
             console.log("user doesn't have edit permission");
    }, function(sender, args){
        console.log('request failed ' + args.get_message() + '\n'+ args.get_stackTrace());

Here is the code you are looking for:

var ctx = new SP.ClientContext.get_current();
var web = context.get_web();

var ob = new SP.BasePermissions();

var per = web.doesUserHavePermissions(ob)
          alert(per.get_value()); // If this is true, user has permission, if not, no 
         alert ("Something wrong");

Instead of web you can check for list.

Found here.

You can also get complete list of permission enumeration here.

If you want to do this via REST API, then references are here and here for you.

  • thanks for your answer.but I need to check whether the current user is having edit list permission for Test List – Jeeva Jeyapaul Jul 4 '17 at 6:41

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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