def put(self, request, group_id, email, format=None):
    ' update role of a group member\n\n        Permission checking:\n        1. only admin can perform this action.\n        '
    if (not request.user.admin_permissions.can_manage_group()):
        return api_error(status.HTTP_403_FORBIDDEN, 'Permission denied.')
    group_id = int(group_id)
    group = ccnet_api.get_group(group_id)
    if (not group):
        error_msg = ('Group %d not found.' % group_id)
        return api_error(status.HTTP_404_NOT_FOUND, error_msg)
    try:
        User.objects.get(email=email)
    except User.DoesNotExist:
        error_msg = ('User %s not found.' % email)
        return api_error(status.HTTP_404_NOT_FOUND, error_msg)
    try:
        if (not is_group_member(group_id, email)):
            error_msg = ('Email %s invalid.' % email)
            return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
    except Exception as e:
        logger.error(e)
        error_msg = 'Internal Server Error'
        return api_error(status.HTTP_500_INTERNAL_SERVER_ERROR, error_msg)
    is_admin = request.data.get('is_admin', '')
    try:
        if (is_admin.lower() == 'true'):
            ccnet_api.group_set_admin(group_id, email)
        elif (is_admin.lower() == 'false'):
            ccnet_api.group_unset_admin(group_id, email)
        else:
            error_msg = 'is_admin invalid.'
            return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
    except Exception as e:
        logger.error(e)
        error_msg = 'Internal Server Error'
        return api_error(status.HTTP_500_INTERNAL_SERVER_ERROR, error_msg)
    member_info = get_group_member_info(request, group_id, email)
    return Response(member_info)
update role of a group member

Permission checking:
1. only admin can perform this action.
def put(self, request, group_id, email, format=None):
    ' update role of a group member\n\n        Permission checking:\n        1. only admin can perform this action.\n        '
    if (not request.user.admin_permissions.can_manage_group()):
        return api_error(status.HTTP_403_FORBIDDEN, 'Permission denied.')
    group_id = int(group_id)
    group = ccnet_api.get_group(group_id)
    if (not group):
        error_msg = ('Group %d not found.' % group_id)
        return api_error(status.HTTP_404_NOT_FOUND, error_msg)
    try:
        User.objects.get(email=email)
    except User.DoesNotExist:
        error_msg = ('User %s not found.' % email)
        return api_error(status.HTTP_404_NOT_FOUND, error_msg)
    try:
        if (not is_group_member(group_id, email)):
            error_msg = ('Email %s invalid.' % email)
            return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
    except Exception as e:
        logger.error(e)
        error_msg = 'Internal Server Error'
        return api_error(status.HTTP_500_INTERNAL_SERVER_ERROR, error_msg)
    is_admin = request.data.get('is_admin', )
    try:
        if (is_admin.lower() == 'true'):
            ccnet_api.group_set_admin(group_id, email)
        elif (is_admin.lower() == 'false'):
            ccnet_api.group_unset_admin(group_id, email)
        else:
            error_msg = 'is_admin invalid.'
            return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
    except Exception as e:
        logger.error(e)
        error_msg = 'Internal Server Error'
        return api_error(status.HTTP_500_INTERNAL_SERVER_ERROR, error_msg)
    member_info = get_group_member_info(request, group_id, email)
    return Response(member_info)