def dacl_add_ace(self, object_dn, ace):
        desc = self.read_sd_on_dn(object_dn)
        desc_sddl = desc.as_sddl(self.domain_sid)
        if ace in desc_sddl:
            return
        if desc_sddl.find("(") >= 0:
            desc_sddl = (desc_sddl[:desc_sddl.index("(")] + ace +
                         desc_sddl[desc_sddl.index("("):])
        else:
            desc_sddl = desc_sddl + ace
        self.modify_sd_on_dn(object_dn, desc_sddl)
Add an ACE to an objects security descriptor
dataset/ETHPy150Open byt3bl33d3r/pth-toolkit/lib/python2.7/site-packages/samba/sd_utils.py/SDUtils.dacl_add_ace