Exemple #1
0
 internal void MergeIf(ADCertificateTemplateAccessRule Rule)
 {
     if (Rule.Identity.Matches(Identity))
     {
         FullControl |= Rule.FullControl;
         Read        |= Rule.Read;
         Write       |= Rule.Write;
         Enroll      |= Rule.Enroll;
         AutoEnroll  |= Rule.AutoEnroll;
     }
 }
Exemple #2
0
        private void GetAccessRules()
        {
            try
            {
                ActiveDirectorySecurity Sec = DirEntry.ObjectSecurity;
                foreach (ActiveDirectoryAccessRule ADRule in Sec.GetAccessRules(true, true, typeof(NTAccount)))
                {
                    ADCertificateTemplateAccessRule CurrRule = new ADCertificateTemplateAccessRule(ADRule);

                    if (AccessRules.FirstOrDefault(p => p.Identity.Matches(CurrRule.Identity)) == null)
                    {
                        AccessRules.Add(CurrRule);
                    }
                    else
                    {
                        AccessRules.ForEach(p => p.MergeIf(CurrRule));
                    }
                }
            }
            catch (Exception ex)
            {
                throw new CertificateTemplateAccessRuleException(this, ex);
            }
        }