SenseNet.ContentRepository.Storage.Security.PermissionEvaluator.GetPermission C# (CSharp) Method

GetPermission() private method

private GetPermission ( string path, IUser user, bool isCreator, bool isLastModifier, PermissionType permissionTypes ) : PermissionValue
path string
user IUser
isCreator bool
isLastModifier bool
permissionTypes SenseNet.ContentRepository.Storage.Schema.PermissionType
return PermissionValue
        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)