From 820c2f6c2d58e8ae05b6b4f8edcbd3bc55202373 Mon Sep 17 00:00:00 2001 From: Thomas Taylor Date: Thu, 9 Jul 2026 19:47:47 +0100 Subject: [PATCH] New: Enable access control (fixes #66) --- lib/AssetsModule.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/AssetsModule.js b/lib/AssetsModule.js index 3b9db68..fb5448d 100644 --- a/lib/AssetsModule.js +++ b/lib/AssetsModule.js @@ -22,10 +22,14 @@ class Assetsmodule extends AbstractApiModule { this.assetTypes = { [LocalAsset.name]: LocalAsset } await this.ensureLibPermissions() - const [authored, mongodb, tags] = await this.app.waitForModule('authored', 'mongodb', 'tags') + const [authored, mongodb, tags, users] = await this.app.waitForModule('authored', 'mongodb', 'tags', 'users') await mongodb.setIndex(this.collectionName, 'hash') await authored.registerModule(this, { accessCheck: false }) await tags.registerModule(this) + // opt into the generic _access model: public access (base) plus per-user sharing. + // Group sharing is wired from the usergroups module. See adapt-authoring-api#98. + await this.enableAccessControl() + await users.registerUserModule(this) this.router.addMiddleware(this.fileUploadMiddleware) this.requestHook.tap(this.onRequest.bind(this))