HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/win_dacl.cpython-310.pyc
o

�N�g��@s8dZdZdd�Zdd�Zdd�Zdd	d
�Zddd
�ZdS)a�	
Windows Object Access Control Lists

Ensure an ACL is present
    parameters:
        name - the path of the object
        objectType - Registry/File/Directory
        user - user account or SID for the ace
        permission - permission for the ace (see module win_acl for available permissions for each objectType)
        acetype -  Allow/Deny
        propagation - how the ACL should apply to child objects (see module win_acl for available propagation types)

    .. code-block:: yaml

        addAcl:
          win_dacl.present:
            - name: HKEY_LOCAL_MACHINE\SOFTWARE\mykey
            - objectType: Registry
            - user: FakeUser
            - permission: FullControl
            - acetype: ALLOW
            - propagation: KEY&SUBKEYS

Ensure an ACL does not exist
    parameters:
        name - the path of the object
        objectType - Registry/File/Directory
        user - user account or SID for the ace
        permission - permission for the ace (see module win_acl for available permissions for each objectType)
        acetype -  Allow/Deny
        propagation - how the ACL should apply to child objects (see module win_acl for available propagation types)

    .. code-block:: yaml

        removeAcl:
          win_dacl.absent:
            - name: HKEY_LOCAL_MACHINE\SOFTWARE\mykey
            - objectType: Registry
            - user: FakeUser
            - permission: FulLControl
            - acetype: ALLOW
            - propagation: KEY&SUBKEYS

Ensure an object is inheriting permissions
    parameters:
        name - the path of the object
        objectType - Registry/File/Directory
        clear_existing_acl - True/False - when inheritance is enabled, should the existing ACL be kept or cleared out

    .. code-block:: yaml

        eInherit:
          win_dacl.enableinheritance:
            - name: HKEY_LOCAL_MACHINE\SOFTWARE\mykey
            - objectType: Registry
            - clear_existing_acl: True

Ensure an object is not inheriting permissions
    parameters:
        name - the path of the object
        objectType - Registry/File/Directory
        copy_inherited_acl - True/False - if inheritance is enabled, should the inherited permissions be copied to the ACL when inheritance is disabled

    .. code-block:: yaml

        dInherit:
          win_dacl.disableinheritance:
            - name: HKEY_LOCAL_MACHINE\SOFTWARE\mykey
            - objectType: Registry
            - copy_inherited_acl: False
�win_daclcCsdtvrdSdS)z6
    Load this state if the win_acl module exists
    �win_dacl.add_acer)Fz#win_dacl module could not be loaded)�__salt__�rr�H/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/win_dacl.py�__virtual__Lsrc	Cs
|didd�}td||||||d�}|dry|dsktdr5d|d<d	|d
<d�||||�|dd
<|Std||||||�}|drXd|d<t|dfi|d��|d<|Sd|d<d�|d
|d
g�|d
<|Stdrwd|d<d|d
<|Sd|d<|d
|d
<|S)z"
    Ensure an ACE is present
    T���name�result�changes�comment�win_dacl.check_acer
�Exists�testNzThe ACE is set to be added.r�{} {} {} on {}rz
Added ACEsrF� zThe ACE is present.�r�__opts__�format�dict�join�	r	�
objectType�userZ
permissionZacetypeZpropagation�ret�tRetZaddRetrrr�presentU�<������rc	Cs
|didd�}td||||||d�}|dry|drktdr5d|d<d	|d
<d�||||�|dd
<|Std||||||�}|drXd|d<t|dfi|d��|d<|Sd|d<d�|d
|d
g�|d
<|Stdrwd|d<d|d
<|Sd|d<|d
|d
<|S)z&
    Ensure an ACL does not exist
    Trrr
r
rrNzThe ACE is set to be removed.rrrzRemoved ACEszwin_dacl.rm_aceFrzThe ACE is not present.rrrrr�absentyrrFcCs|didd�}td||�}|dru|dsgtdr4d|d<d	|d
d<d|d<|r,d
nd|d
d<|Std|||�}|drTd|d<t|d
fi|d
��|d
<|Sd|d<d�|d|dg�|d<|Stdrsd|d<d|d<|Sd|d<|d|d<|S)z=
    Ensure an object is inheriting ACLs from its parent
    Trr�win_dacl.check_inheritancer
�InheritancerNZEnabledrz!Inheritance is set to be enabled.r�Are set to be removed�Are set to be keptz
Existing ACLszwin_dacl.enable_inheritanceFrzInheritance is enabled.�rrrr)r	rZclear_existing_aclrr�eRetrrr�inherit�s<�
�����r%TcCs�|didd�}td||�}|drs|dretdr4d|d<d	|d
d<d|d<|r,d
nd|d
d<|Std|||�}|d|d<|drVt|d
fi|d
��|d
<|Sd�|d|dg�|d<|Stdrqd|d<d|d<|Sd|d<|d|d<|S)zA
    Ensure an object is not inheriting ACLs from its parent
    Trrrr
r rNZDisabledrz"Inheritance is set to be disabled.rr"r!zInherited ACLszwin_dacl.disable_inheritancerzInheritance is disabled.Fr#)r	rZcopy_inherited_aclrrr$rrr�
disinherit�s:�
��
���r&N)F)T)�__doc__Z__virtualname__rrrr%r&rrrr�<module>sH	$
$%