internal PermissionValue GetPermission(string path, IUser user, bool isCreator, bool isLastModifier, PermissionType[] permissionTypes)
{
if (user.Id == -1)
return PermissionValue.Allow;
//==>
var principals = GetPrincipals(user, isCreator, isLastModifier);
var allow = 0;
var deny = 0;
var firstPermInfo = GetFirstInfo(path);
if (firstPermInfo.Path == path)
firstPermInfo.AggregateLevelOnlyValues(principals, ref allow, ref deny);
for (var permInfo = firstPermInfo; permInfo != null; permInfo = permInfo.Inherits ? permInfo.Parent : null)
permInfo.AggregateEffectiveValues(principals, ref allow, ref deny);
//==<
var mask = GetPermissionMask(permissionTypes);
if ((deny & mask) != 0)
return PermissionValue.Deny;
if ((allow & mask) != mask)
return PermissionValue.NonDefined;
return PermissionValue.Allow;
}
internal PermissionValue GetSubtreePermission(string path, IUser user, bool isCreator, bool isLastModifier, PermissionType[] permissionTypes)