def METHOD_NAME(
    self,
    organization_id: OrganizationID,
    realm_id: RealmID,
    user_id: UserID,
    operation_kind: OperationKind,
) -> None:
    assert self._realm_component is not None
    try:
        realm = self._realm_component._get_realm(organization_id, realm_id)
    except RealmNotFoundError:
        raise BlockNotFoundError(f"Realm `{realm_id.hex}` doesn't exist")
    allowed_roles: Tuple[RealmRole, ...]
    if operation_kind == operation_kind.DATA_READ:
        allowed_roles = (
            RealmRole.OWNER,
            RealmRole.MANAGER,
            RealmRole.CONTRIBUTOR,
            RealmRole.READER,
        )
    elif operation_kind == operation_kind.DATA_WRITE:
        allowed_roles = (RealmRole.OWNER, RealmRole.MANAGER, RealmRole.CONTRIBUTOR)
    elif operation_kind == operation_kind.MAINTENANCE:
        allowed_roles = (RealmRole.OWNER,)
    else:
        assert False, f"Operation kind {operation_kind} not supported"
    if realm.roles.get(user_id) not in allowed_roles:
        raise BlockAccessError()
    # Special case of reading while in reencryption is authorized
    if realm.status.in_reencryption and operation_kind == OperationKind.DATA_READ:
        pass
    # Access is not allowed while in maintenance
    elif realm.status.in_maintenance:
        raise BlockInMaintenanceError(f"Realm `{realm_id.hex}` is currently under maintenance")