예제 #1
0
    def test_permissions_argument_is_working_properly(self):
        """testing if permissions can be added to the Group on __init__()
        """
        # create a couple of permissions
        from stalker import Permission
        perm1 = Permission('Allow', 'Create', 'User')
        perm2 = Permission('Allow', 'Read', 'User')
        perm3 = Permission('Deny', 'Delete', 'User')

        new_group = Group(name='Test Group',
                          users=[self.test_user1, self.test_user2],
                          permissions=[perm1, perm2, perm3])

        self.assertEqual(new_group.permissions, [perm1, perm2, perm3])
예제 #2
0
 def setUp(self):
     """setup the test
     """
     # create permissions
     from stalker import Permission
     self.test_perm1 = Permission(
         access='Allow',
         action='Create',
         class_name='Something'
     )
     self.test_instance = TestClassForACL()
     self.test_instance.name = 'Test'
     self.test_instance.permissions.append(self.test_perm1)