'Returns True if and only if the user id in the query is the id of the currently logged in user.'

def _user_matches_query(self, bundle):

    user_actual = self._get_user(bundle)
    if (not user_actual):
        return False
    user_queried = bundle.request.GET.get('user')
    if (not user_queried):
        return False
    return (user_actual.id == user_queried)
