1

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.

0
2

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

2
  • Perfect, thanks! Do you know if the HasRights javascript method works in SP2007? 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

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.