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

I am writing JavaScript that will show a menu item for the document ECB menu in a SharePoint document library. I want to only show the item if the current user has the ability to edit the item.

It appears that calling the "HasRights" function within core.js is the right move, but I cannot seem to find a definitive reference on what values I should use to call it with.

In looking through core.js I see an indication that the following is correct once in the context of a particular drop down.

HasRights(0x0, 0x4)

My tests also indicate that it is the right check. However, I would feel a lot better if there were some definition of this somewhere.

Also, does HasRights work for both SharePoint 2007 and SharePoint 2010? I am testing in SharePoint 2010 but need this to work in SharePoint 2007 as well.

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

Here's a reference to the Rights Mask values used by this function.

share|improve this answer
    
Perfect, thanks! Do you know if the HasRights javascript method works in SP2007? –  Kirk Liemohn Jun 22 '11 at 13:44
    
I do not have a 2007 environment to check, but I did a search and found blog posts using HasRights() in core.js in SP2007. And the reference above is for WSS. –  Laurie Jun 22 '11 at 13:51
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.