API Reference > imodeljs-backend > iModels > BriefcaseDb > onOpen onOpen StaticReadonly onOpen: BeEvent<(_requestContext: ClientRequestContext, _props: IModelRpcProps) => void> = ... Event raised just before a BriefcaseDb is opened. If the open requires authorization AuthorizedClientRequestContext is passed in to the event handler. Otherwise ClientRequestContext is passed in Example: BriefcaseDb.onOpen.addListener((_requestContext: AuthorizedClientRequestContext | ClientRequestContext, briefcaseProps: IModelRpcProps) => { // A read-only service might want to reject all requests to open an iModel for writing. It can do this in the onOpen event. if (briefcaseProps.openMode !== OpenMode.Readonly) throw new IModelError(IModelStatus.BadRequest, "Navigator is readonly"); }); Defined in core/backend/src/IModelDb.ts Line 2157 Last Updated: 11 June, 2024