def METHOD_NAME(self, project_id, user_id):
    collaborator = g.db.execute_one(
                """
                SELECT role FROM collaborator
                WHERE user_id = %s
                AND project_id = %s
                LIMIT 1
            """, [str(user_id), project_id])
    if not collaborator:
        abort(400, 'Specified user is not in collaborators list.')
    if collaborator[0] == 'Owner':
        if count_owner(project_id) <= 1:
            abort(400, 'The project must have an owner.')
        if not is_valid_admin(project_id, g.token['user']['id']):
            abort(400, 'Not authorized to change owner')
    b = request.get_json()
    userrole = b['role']
    # Ensure that role is valid
    roles = g.db.execute_many(
        """
        SELECT unnest(enum_range(NULL::user_role))
    """)
    if [userrole] not in roles:
        abort(400, "Role unknown.")
    # Do update
    g.db.execute(
        """
        UPDATE collaborator
        SET role = %s
        WHERE user_id = %s
        AND project_id = %s
    """, [userrole, str(user_id), project_id])
    g.db.commit()
    opa_push_collaborator_data(g.db)
    return OK('Successfully changed user role.')