示例#1
0
        public bool TryCheck(UserContext ctx, DataOperation op)
        {
            ACLVerdict result = Apply(ctx, op);

            switch (result)
            {
            case ACLVerdict.Denied:
            case ACLVerdict.None:
                return(false);
            }

            return(true);
        }
示例#2
0
        public bool TryCheck(ManagedSecurityContext sec, DataOperation op)
        {
            ACLVerdict result = Apply(sec, op);

            switch (result)
            {
            case ACLVerdict.Denied:
            case ACLVerdict.None:
                return(false);
            }

            return(true);
        }
示例#3
0
        public ACLVerdict Apply(UserContext ctx, DataOperation op)
        {
            ACLVerdict current = ACLVerdict.Denied;

            foreach (IACLEntry entry in _accessControlList)
            {
                ACLVerdict result = entry.Apply(ctx, op);
                switch (result)
                {
                case ACLVerdict.Denied:
                    return(ACLVerdict.Denied);

                case ACLVerdict.Allowed:
                    current = ACLVerdict.Allowed;
                    break;
                }
            }

            return(current);
        }
示例#4
0
        public ACLVerdict Apply(ManagedSecurityContext sec, DataOperation op)
        {
            ACLVerdict current = ACLVerdict.Denied;

            foreach (IACLEntry entry in mAccessControlList)
            {
                ACLVerdict result = entry.Apply(sec, op);
                switch (result)
                {
                case ACLVerdict.Denied:
                    return(ACLVerdict.Denied);

                case ACLVerdict.Allowed:
                    current = ACLVerdict.Allowed;
                    break;
                }
            }

            return(current);
        }