Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Users will have read permission at web level but in some scenario few users can have edit permission on just one list under the web (role is broken for the list and explicit permission is given on the list for specific users)

Is it possible to check if a particular user has edit permission on just that list using ecma script client object model.

If i try to use permissionsToCheck.set(SP.PermissionKind.editListItems); on the web object, the api returns false. I believe the behavior is so, as user has read permission on web and all lists, doc lib except for one list where he has edit permission

EDIT: Thanks steve ... this is how I got it work (Disclaimer: This is not the actual tested code, I just wanted to highlight the part where we are requesting EffectiveBasePermissions explicitly ie., this line clientContext.load(list, 'EffectiveBasePermissions');

function foo(){
            ...
var list = clientContext.get_web().get_lists().getByTitle('Notes');
           clientContext.load(list);
           clientContext.load(list, 'EffectiveBasePermissions');   
           clientContext.executeQueryAsync(Function.createDelegate(this, bar), Function.createDelegate(this, onFailureToRetrieve));   
}

function bar(){
    var perm = this.discussionList.get_effectiveBasePermissions();
    alert( perm.has(SP.PermissionKind.editListItems) );
    ...
}
share|improve this question
    
Thanks steve ... this how I got it work –  JeeZ Jun 21 '12 at 14:07
add comment

1 Answer 1

up vote 1 down vote accepted

Yes, you just need to get a reference to the list object. Here is a link to a blog post that might help: http://blogs.technet.com/b/speschka/archive/2009/11/01/using-the-sharepoint-2010-client-object-model-part-5.aspx

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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