def METHOD_NAME(request, project_pk):
    user = request.user
    project = get_object_or_404(Project, id=project_pk)
    can_manage_users = user.has_perm('rsr.user_management', project)
    if not can_manage_users and not user.can_edit_enumerator_access(project):
        return Response('Request not allowed', status=status.HTTP_403_FORBIDDEN)
    email, role, name = request.data.get('email'), request.data.get('role'), request.data.get('name')
    if not (email and role):
        return Response({'error': _('Email and Role are required keys')},
                        status=status.HTTP_400_BAD_REQUEST)
    group = Group.objects.filter(name=role).first()
    if group is None:
        return Response({'error': _('Role does not exist')}, status=status.HTTP_400_BAD_REQUEST)
    if not can_manage_users and group.name != 'Enumerators':
        return Response('Request not allowed', status=status.HTTP_403_FORBIDDEN)
    invited_user = create_invited_user(email)
    project_role, __ = ProjectRole.objects.get_or_create(project=project, user=invited_user, group=group)
    if not invited_user.is_active:
        first_name, last_name = (name.split(' ', 1) + [''])[:2]
        invited_user.first_name = first_name
        invited_user.last_name = last_name
        invited_user.save(update_fields=['first_name', 'last_name'])
        send_user_invitation(email, user, invited_user, employment=None, project=project)
    data = {'status': _('User invited'), 'role': ProjectRoleSerializer(project_role).data}
    return Response(data, status=status.HTTP_201_CREATED)