async def METHOD_NAME(administrator):
    client = await spawn_client(authorize=True, administrator=administrator)
    authorization_client = client.app["authorization"]
    if not administrator:
        await authorization_client.remove(
            *[
                AdministratorRoleAssignment("test", role)
                for role in AdministratorRole
            ]
        )
    group_1 = await fake2.groups.create()
    group_2 = await fake2.groups.create()
    groups = get_data_from_app(client.app).groups
    await groups.update(
        group_1.id,
        UpdateGroupRequest(permissions=UpdatePermissionsRequest(upload_file=True)),
    )
    await groups.update(
        group_2.id,
        UpdateGroupRequest(
            permissions=UpdatePermissionsRequest(
                create_sample=True, create_ref=True
            )
        ),
    )
    user = await fake2.users.create(groups=[group_1])
    await authorization_client.remove(
        *[AdministratorRoleAssignment(user.id, role) for role in AdministratorRole]
    )
    return client, group_1, group_2, user