object ICloneable.Clone()
        {
            Acl newAcl = new Acl();

            foreach(Ace entry in _acl)
                newAcl._acl.Add(new Ace(entry.User, entry.AccountNameMapped, entry.Permission, entry.OtherPerm));

            return newAcl;
        }
Exemple #2
0
        private static UrlAclConfigItem Deserialize(IntPtr pUrlAclConfigSetStruct)
        {
            UrlAclConfigItem item = new UrlAclConfigItem();

            HttpApi.HTTP_SERVICE_CONFIG_URLACL_SET aclStruct =
                (HttpApi.HTTP_SERVICE_CONFIG_URLACL_SET)Marshal.PtrToStructure(pUrlAclConfigSetStruct, typeof(HttpApi.HTTP_SERVICE_CONFIG_URLACL_SET));

            item.Url = aclStruct.KeyDesc.pUrlPrefix;

            item.Dacl = Acl.FromSddl(aclStruct.ParamDesc.pStringSecurityDescriptor);

            item.Status = ModifiedStatus.Unmodified;

            return(item);
        }
        internal static Acl FromSddl(string sddl)
        {
            Acl newAcl = new Acl();

            string[] aceStrings = sddl.Split(new char[] { '(', ')' });

            // it's split on ( and ), so we have blanks every other item
            for(int i = 1; i < aceStrings.Length; i++)
            {
                if((i % 2) > 0)
                    newAcl._acl.Add(Ace.FromSddl(aceStrings[i]));
            }

            return newAcl;
        }
Exemple #4
0
        public static Acl FromSddl(string sddl)
        {
            Acl newAcl = new Acl();

            string[] aceStrings = sddl.Split(new char[] { '(', ')' });

            // it's split on ( and ), so we have blanks every other item
            for (int i = 1; i < aceStrings.Length; i++)
            {
                if ((i % 2) > 0)
                {
                    newAcl._acl.Add(Ace.FromSddl(aceStrings[i]));
                }
            }

            return(newAcl);
        }