Exemplo n.º 1
0
        public static string ToString(PrincipalIdentifier principalIdentifier)
        {
            switch (principalIdentifier.Kind)
            {
            case PrincipalIdentifierKind.Claim:
                return(ToString((ClaimPrincipalIdentifier)principalIdentifier));

            case PrincipalIdentifierKind.Role:
                return(ToString((RolePrincipalIdentifier)principalIdentifier));

            case PrincipalIdentifierKind.Windows:
                return(ToString((WindowsPrincipalIdentifier)principalIdentifier));

            case PrincipalIdentifierKind.X509:
                return(ToString((X509PrincipalIdentifier)principalIdentifier));

            default:
                return(string.Format(CultureInfo.InvariantCulture, "Unknown PrincipalIdentifier {0}", principalIdentifier.Kind));
            }
        }
Exemplo n.º 2
0
        public UserGroupMembershipFact(
            PrincipalIdentifier user,
            PrincipalIdentifier group
            )
            : base(
                "GroupMembership",
                user,
                group)
        {
            if (user == null)
            {
                throw new ArgumentNullException("user");
            }

            if (group == null)
            {
                throw new ArgumentNullException("group");
            }

            this.User  = user;
            this.Group = group;
        }
Exemplo n.º 3
0
 public AllowedAce(PrincipalIdentifier principal)
     : base(AceType.Allowed, principal)
 {
 }
Exemplo n.º 4
0
 public AllowedAce(PrincipalIdentifier principal, AccessMask accessMask)
     : base(AceType.Allowed, principal, accessMask)
 {
 }
Exemplo n.º 5
0
        public ResourceAccessFact(
            PrincipalIdentifier resource, PrincipalIdentifier module, PrincipalIdentifier group,
            IntegerIdentifier from, IntegerIdentifier to, IntegerIdentifier dayOfWeek,
            VerbIdentifier accessMode, IntegerIdentifier priority
            )
            : base(
                "ResourceAccess",
                resource, module, group,
                from, to, dayOfWeek,
                accessMode, priority)
        {
            if (resource == null)
            {
                throw new ArgumentNullException("resource");
            }

            if (module == null)
            {
                throw new ArgumentNullException("module");
            }

            if (group == null)
            {
                throw new ArgumentNullException("target");
            }

            if (from == null)
            {
                throw new ArgumentNullException("from");
            }

            if (to == null)
            {
                throw new ArgumentNullException("to");
            }

            if (dayOfWeek == null)
            {
                throw new ArgumentNullException("dayOfWeek");
            }

            if (accessMode == null)
            {
                throw new ArgumentNullException("accessMode");
            }

            if (priority == null)
            {
                throw new ArgumentNullException("priority");
            }

            this.Resource = resource;
            this.Module   = module;
            this.Group    = group;

            this.From      = from;
            this.To        = to;
            this.DayOfWeek = dayOfWeek;

            this.AccessMode = accessMode;
            this.Priority   = priority;
        }
Exemplo n.º 6
0
        public UserGroupMembershipFact(
            PrincipalIdentifier user,
            PrincipalIdentifier group
            )
            : base("GroupMembership",
                user,
                group)
        {
            if (user == null)
            {
                throw new ArgumentNullException("user");
            }

            if (group == null)
            {
                throw new ArgumentNullException("group");
            }

            this.User = user;
            this.Group = group;
        }
Exemplo n.º 7
0
        public ResourceAccessFact(
            PrincipalIdentifier resource, PrincipalIdentifier module, PrincipalIdentifier group,
            IntegerIdentifier from, IntegerIdentifier to, IntegerIdentifier dayOfWeek,
            VerbIdentifier accessMode, IntegerIdentifier priority
            )
            : base("ResourceAccess",
                resource, module,  group,
                from, to, dayOfWeek,
                accessMode, priority)
        {
            if (resource == null)
            {
                throw new ArgumentNullException("resource");
            }

            if (module == null)
            {
                throw new ArgumentNullException("module");
            }

            if (group == null)
            {
                throw new ArgumentNullException("target");
            }

            if (from == null)
            {
                throw new ArgumentNullException("from");
            }

            if (to == null)
            {
                throw new ArgumentNullException("to");
            }

            if (dayOfWeek == null)
            {
                throw new ArgumentNullException("dayOfWeek");
            }

            if (accessMode == null)
            {
                throw new ArgumentNullException("accessMode");
            }

            if (priority == null)
            {
                throw new ArgumentNullException("priority");
            }

            this.Resource = resource;
            this.Module = module;
            this.Group = group;

            this.From = from;
            this.To = to;
            this.DayOfWeek = dayOfWeek;

            this.AccessMode = accessMode;
            this.Priority = priority;
        }