Exemplo n.º 1
0
 def test_ace_reset_inherited(self):
     ace = _aces.ACE(everyone, ntsecuritycon.GENERIC_ALL,
                     win32security.ACCESS_ALLOWED_ACE_TYPE)
     ace.flags |= win32security.INHERITED_ACE
     assert ace.inherited
     ace.inherited = False
     assert not ace.flags & win32security.INHERITED_ACE
Exemplo n.º 2
0
 def test_ace_reset_objects_inherit(self):
     ace = _aces.ACE(everyone, ntsecuritycon.GENERIC_ALL,
                     win32security.ACCESS_ALLOWED_ACE_TYPE)
     ace.flags &= ~win32security.INHERITED_ACE
     ace.flags |= win32security.OBJECT_INHERIT_ACE
     assert ace.objects_inherit
     ace.objects_inherit = False
     assert not ace.flags & win32security.OBJECT_INHERIT_ACE
Exemplo n.º 3
0
 def test_ace_reset_containers_inherit(self):
     ace = _aces.ACE(everyone, ntsecuritycon.GENERIC_ALL,
                     win32security.ACCESS_ALLOWED_ACE_TYPE)
     ace.flags &= ~win32security.INHERITED_ACE
     ace.flags |= win32security.CONTAINER_INHERIT_ACE
     assert ace.containers_inherit
     ace.containers_inherit = False
     assert not ace.flags & win32security.CONTAINER_INHERIT_ACE
Exemplo n.º 4
0
 def test_ace_set_trustee_inherited(self):
     with self.assertRaises(_aces.exc.x_access_denied):
         _aces.ACE(everyone, ntsecuritycon.GENERIC_ALL,
                   win32security.ACCESS_ALLOWED_ACE_TYPE,
                   win32security.INHERITED_ACE).trustee = ""
Exemplo n.º 5
0
 def test_ace_trustee_string(self):
     ace = _aces.ACE(everyone, ntsecuritycon.GENERIC_ALL,
                     win32security.ACCESS_ALLOWED_ACE_TYPE)
     assert ace._trustee == everyone
     ace.trustee = "Administrators"
     assert ace._trustee == administrators
Exemplo n.º 6
0
 def test_ace_trustee_principal(self):
     ace = _aces.ACE(everyone, ntsecuritycon.GENERIC_ALL,
                     win32security.ACCESS_ALLOWED_ACE_TYPE)
     assert ace._trustee == everyone
     ace.trustee = me
     assert ace._trustee == me
Exemplo n.º 7
0
 def test_ace_access_string(self):
     ace = _aces.ACE(everyone, ntsecuritycon.GENERIC_ALL,
                     win32security.ACCESS_ALLOWED_ACE_TYPE)
     assert ace._access_mask == ntsecuritycon.GENERIC_ALL
     ace.access = "W"
     assert ace._access_mask == ntsecuritycon.GENERIC_WRITE
Exemplo n.º 8
0
 def test_ace_access_int(self):
     ace = _aces.ACE(everyone, ntsecuritycon.GENERIC_ALL,
                     win32security.ACCESS_ALLOWED_ACE_TYPE)
     assert ace._access_mask == ntsecuritycon.GENERIC_ALL
     ace.access = ntsecuritycon.GENERIC_READ
     assert ace._access_mask == ntsecuritycon.GENERIC_READ
Exemplo n.º 9
0
def test_ace_set_trustee_inherited():
    _aces.ACE(everyone, ntsecuritycon.GENERIC_ALL,
              win32security.ACCESS_ALLOWED_ACE_TYPE,
              win32security.INHERITED_ACE).trustee = ""
Exemplo n.º 10
0
def test_ace_set_objects_inherit_inherited():
    _aces.ACE(everyone, ntsecuritycon.GENERIC_ALL,
              win32security.ACCESS_ALLOWED_ACE_TYPE,
              win32security.INHERITED_ACE).objects_inherit = True
Exemplo n.º 11
0
def test_ace_not_objects_inherit():
    ace = _aces.ACE(everyone, ntsecuritycon.GENERIC_ALL,
                    win32security.ACCESS_ALLOWED_ACE_TYPE)
    ace.flags &= ~win32security.OBJECT_INHERIT_ACE
    assert not ace.objects_inherit
Exemplo n.º 12
0
def test_ace_not_containers_inherit():
    ace = _aces.ACE(everyone, ntsecuritycon.GENERIC_ALL,
                    win32security.ACCESS_ALLOWED_ACE_TYPE)
    ace.flags &= ~win32security.CONTAINER_INHERIT_ACE
    assert not ace.containers_inherit
Exemplo n.º 13
0
def test_ace_not_inherited():
    ace = _aces.ACE(everyone, ntsecuritycon.GENERIC_ALL,
                    win32security.ACCESS_ALLOWED_ACE_TYPE)
    ace.flags &= ~win32security.INHERITED_ACE
    assert not ace.inherited