def test_has_perm_anonymous(self): auth = UnixAuthorizer(global_perm='elr', anonymous_user=self.get_current_user()) self.assertTrue(auth.has_perm(self.get_current_user(), 'r')) self.assertFalse(auth.has_perm(self.get_current_user(), 'w')) self.assertTrue(auth.has_perm('anonymous', 'e')) self.assertFalse(auth.has_perm('anonymous', 'w')) warnings.filterwarnings("ignore") auth.override_user('anonymous', perm='w') warnings.resetwarnings() self.assertTrue(auth.has_perm('anonymous', 'w'))
def test_has_perm_anonymous(self): auth = UnixAuthorizer( global_perm='elr', anonymous_user=self.get_current_user()) self.assertTrue(auth.has_perm(self.get_current_user(), 'r')) self.assertFalse(auth.has_perm(self.get_current_user(), 'w')) self.assertTrue(auth.has_perm('anonymous', 'e')) self.assertFalse(auth.has_perm('anonymous', 'w')) warnings.filterwarnings("ignore") auth.override_user('anonymous', perm='w') warnings.resetwarnings() self.assertTrue(auth.has_perm('anonymous', 'w'))