def test_user_has_permissions_on_object(self):
        """Test that a user has a role on an object"""
        self.user1.link_to_acl(self.entity1, roles.Role.OWNER)
        has_permissions = self.user1.has_permissions(
            self.entity1.extended_id, roles.Role.OWNER
        )
        self.assertTrue(has_permissions)
        has_permissions = self.user1.has_permissions(
            self.entity2.extended_id, roles.Role.OWNER
        )
        self.assertFalse(has_permissions)
Test that a user has a role on an object
tests/schemas/rbac.py