remult 0.25.5-exp.22 → 0.25.5-exp.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -195,13 +195,16 @@ export class RemultServerImplementation {
195
195
  },
196
196
  doWork: undefined,
197
197
  }, r);
198
- if (this.options.admin) {
198
+ if (this.options.admin !== undefined && this.options.admin !== false) {
199
199
  r.route(this.options.rootPath + '/admin*').get(this.process(async (remult, req, res, orig, origResponse) => {
200
- origResponse.send(remultAdminHtml({
201
- remult: remult,
202
- entities: this.options.entities,
203
- baseUrl: this.options.rootPath + '/admin',
204
- }));
200
+ if (remult.isAllowed(this.options.admin))
201
+ origResponse.send(remultAdminHtml({
202
+ remult: remult,
203
+ entities: this.options.entities,
204
+ baseUrl: this.options.rootPath + '/admin',
205
+ }));
206
+ else
207
+ res.notFound();
205
208
  }));
206
209
  }
207
210
  if (this.options.subscriptionServer instanceof SseSubscriptionServer) {