def test_grantAccess( self ): user = MockUser( ) component = Component( 'random' ) self.assertEquals( [], user.grantedPermissions ) component.grantAccessFor( user ) self.assertEquals([ 'component_random' ], user.grantedPermissions ) self.assertTrue( component.canBeAccessedBy( user ))
def test_removeAccess( self ): user = MockUser() component = Component( 'random' ) component.grantAccessFor( user ) component.forbidAccessFor( user ) self.assertFalse( component.canBeAccessedBy( user ))