Permission / Deny Mask in SharePoint

I have a question about SharePoint permission masks. In SharePoint, you can set grant / deny rights using masks. Details are provided in the following article.

http://msdn.microsoft.com/en-us/library/dd304243 (PROT.13) .aspx

My question is when do we have a permission / denial mask.

For example, if you renounce ViewItem permission using the central administrator, you will receive 4611686844973976575 as a reject mask. This permission mask is calculated using aping | to several individual permission masks.

So, is it possible to extract individual permission masks that are used to calculate the permission mask, for example 4611686844973976575?

Thank.

+4
source share
2

, 0x0000000000000001 "ViewListItems", , ( 1). , , "UseClientIntegration" 0x0000001000000000, (0). , Windows - , , , 4611686844973976575 10 400000C072040BFF ( 16).

, . , . , , , , #:

bool CheckMask( long Mask, long TestPermission ) {
    return (Mask && TestPermission) > 0;
}

long mask = 4611686844973976575;

const long ViewListItems = 0x0000000000000001;
bool HasPermission_ViewListItems = CheckMask(mask, ViewListItems);
// HasPermission_ViewListItems is true

const long UseClientIntegration = 0x0000001000000000;
bool HasPermission_UseClientIntegration = CheckMask(mask, UseClientIntegration);
// HasPermission_UseClientIntegration is false
+4

javascript @zanlok answer

JQuery, SPServices js (http://spservices.codeplex.com/) http://msdn.microsoft.com/en-us/library/dd304243%28PROT.13%29.aspx , , , , .

, html, LIST NAME .

script , , , , , . , .

$('#divid').html('Working...').SPServices({
    operation: "GetPermissionCollection",
    objectName: 'LIST NAME HERE',
    objectType: "List",
    completefunc: function (xData, Status) {
        var out = "<ul>";
        $(xData.responseXML).find("Permission").each(function () {
            if ($(this).attr("MemberIsUser") === "True") {
                out += "<li>User: " + $(this).attr("UserLogin") + "</li>";
            } else {
                out += "<li>Group: " + $(this).attr("GroupName") + "</li>";
            }
            var readmask = 0x0000000000000001;
            var addmask = 0x0000000000000002;
            var editmask = 0x0000000000000004;
            var deletemask = 0x0000000000000008;
            out += "<li>Mask: " + $(this).attr("Mask") + "</li>";
            var canread = readmask & $(this).attr("Mask").toString(16) > 0 ? "Yes" : "No";
            var canadd = addmask & $(this).attr("Mask").toString(16) > 0 ? "Yes" : "No";
            var canedit = editmask & $(this).attr("Mask").toString(16) > 0 ? "Yes" : "No";
            var candelete = deletemask & $(this).attr("Mask").toString(16) > 0 ? "Yes" : "No";
            out += "<li>Can Read: " + canread + "</li>";
            out += "<li>Can Add: " + canadd + "</li>";
            out += "<li>Can Edit: " + canedit + "</li>";
            out += "<li>Can Delete: " + candelete + "</li>";
        });
        out += "</ul>";
        $('divid').html(out);
    }
});
+2

All Articles