async def METHOD_NAME(
    conn: triopg._triopg.TrioConnectionProxy,
    organization_id: OrganizationID,
    realm_id: RealmID,
    encryption_revision: int | None,
    operation_kind: OperationKind,
) -> None:
    # Get the current realm status
    try:
        status = await get_realm_status(conn, organization_id, realm_id)
    except RealmNotFoundError as exc:
        raise VlobRealmNotFoundError(*exc.args) from exc
    # Special case of reading while in reencryption
    if operation_kind == OperationKind.DATA_READ and status.in_reencryption:
        # Starting a reencryption maintenance bumps the encryption revision.
        # Hence if we are currently in reencryption maintenance, last encryption revision is not ready
        # to be used (it will be once the reencryption is over !).
        # So during this intermediary state, we allow read access to the previous encryption revision instead.
        # Note that `encryption_revision` might also be `None` in the case of `poll_changes` and `list_versions`
        # requests, which should also be allowed during a reencryption
        # The vlob is not available yet for the current revision
        if encryption_revision is not None and encryption_revision == status.encryption_revision:
            raise VlobInMaintenanceError(f"Realm `{realm_id.hex}` is currently under maintenance")
        # The vlob is only available at the previous revision
        if (
            encryption_revision is not None
            and encryption_revision != status.encryption_revision - 1
        ):
            raise VlobEncryptionRevisionError()
    # In all other cases
    else:
        # Access during maintenance is forbidden
        if operation_kind != OperationKind.MAINTENANCE and status.in_maintenance:
            raise VlobInMaintenanceError("Data realm is currently under maintenance")
        # A maintenance state was expected
        if operation_kind == OperationKind.MAINTENANCE and not status.in_maintenance:
            raise VlobNotInMaintenanceError(f"Realm `{realm_id.hex}` not under maintenance")
        # Otherwise simply check that the revisions match
        if encryption_revision is not None and status.encryption_revision != encryption_revision:
            raise VlobEncryptionRevisionError()