public void SetSystemAclProtection(bool isProtected,
                                           bool preserveInheritance)
        {
            if (!isProtected)
            {
                flags &= ~ControlFlags.SystemAclProtected;
                return;
            }

            flags |= ControlFlags.SystemAclProtected;
            if (!preserveInheritance && SystemAcl != null)
            {
                SystemAcl.RemoveInheritedAces();
            }
        }
Ejemplo n.º 2
0
        public void SetSystemAclProtection(bool isProtected, bool preserveInheritance)
        {
            if (!isProtected)
            {
                RemoveControlFlags(ControlFlags.SystemAclProtected);
            }
            else
            {
                if (!preserveInheritance && SystemAcl != null)
                {
                    SystemAcl.RemoveInheritedAces();
                }

                AddControlFlags(ControlFlags.SystemAclProtected);
            }
        }