def METHOD_NAME(self):
    password_salt = generate_salt()
    user = User.create(
        email='editor@edit.com',
        password_hash=create_bcrypt_hash('edit', password_salt),
        password_salt=password_salt,
        roles_new=[Role.create(
            name='pipeline_editor_1',
            permissions=[
                Permission.create(
                    entity=Entity.PIPELINE,
                    entity_id='test',
                    access=4,
                )
            ]
        )],
        username='editor',
    )
    access = user.get_access(Entity.ANY)
    self.assertEqual(4, access)
    access = user.get_access(Entity.GLOBAL, None)
    self.assertEqual(0, access)
    access = user.get_access(Entity.PIPELINE, 'test')
    self.assertEqual(4, access)
    access = user.get_access(Entity.PIPELINE, 'not_test')
    self.assertEqual(0, access)
    self.assertTrue(has_at_least_viewer_role(user, Entity.PIPELINE, 'test'))
    self.assertTrue(has_at_least_editor_role(user, Entity.PIPELINE, 'test'))