This project has moved and is read-only. For the latest updates, please go here.

GetRolesAndPermissionsForCurrentUser - using & to check individual permissions

Jul 16, 2012 at 3:42 PM


var userPerm =$(xData.responseXML).find("Permissions").attr("Value");
        var hide = (16 & userPerm) != 16;

For some reason, hide evaluates to true in the first test when userPerm is = 9223372036854775807 so I had to add the extra test to set it back to false (I shouldn't have to do this though). This probably happens with other permission levels as well, not just full control. If they have the approver permission (16), then (16 & userPerm) != 16; should evaluate to false, right? Mine is evaluating to true;

Aug 6, 2012 at 1:39 PM

I am new to spservices ...Need help

hi I want to know which operation u used to get the current user's permissions

Aug 6, 2012 at 7:02 PM

I'd start here.


Aug 7, 2012 at 8:38 AM

want to know the textual permission corresponding to a permission value

I get the permission value by calling webservice method GetRolesAndPermissionsForCurrentUser

Aug 7, 2012 at 12:33 PM

You'll have to "and" the permissions out of the permission mask, as shown above.


Aug 9, 2012 at 8:14 PM

I've noticed that in javascript, the full permission 0x7FFFFFFFFFFFFFFF (or in decimal, 9223372036854775807) is too large to perform any bitwise operations or even simple arithmetic. It treats numbers that are too large as 9223372036854776000. Does anyone know a way around this?