Пример #1
0
        internal SharingPolicyAction GetAllowed(string domain)
        {
            SharingPolicyAction sharingPolicyAction = (SharingPolicyAction)0;

            if (this.Enabled)
            {
                foreach (SharingPolicyDomain sharingPolicyDomain in this.Domains)
                {
                    if (SharingPolicy.IsDomainMatch(sharingPolicyDomain.Domain, domain))
                    {
                        sharingPolicyAction |= sharingPolicyDomain.Actions;
                    }
                }
            }
            return(sharingPolicyAction);
        }
Пример #2
0
 internal bool IsAllowedForAnySharing(string domain, SharingPolicyAction actions)
 {
     if (this.Enabled)
     {
         foreach (SharingPolicyDomain sharingPolicyDomain in this.Domains)
         {
             if ((sharingPolicyDomain.Actions & actions) != (SharingPolicyAction)0 && SharingPolicy.IsDomainMatch(sharingPolicyDomain.Domain, domain))
             {
                 return(true);
             }
         }
         return(false);
     }
     return(false);
 }