Skip to content

Commit 386e04f

Browse files
committed
BREAKING CHANGE: support new version of upload plugin which requires storageAdapter instead of fixed s3
1 parent d7d946a commit 386e04f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ export default class RichEditorPlugin extends AdminForthPlugin {
5757
throw new Error(`Plugin for attachment field '${this.options.attachments!.attachmentFieldName}' not found in resource '${this.options.attachments!.attachmentResource}', please check if Upload Plugin is installed on the field ${this.options.attachments!.attachmentFieldName}`);
5858
}
5959

60-
if (plugin.pluginOptions.s3ACL !== 'public-read') {
60+
if (!plugin.pluginOptions.storageAdapter.objectCanBeAccesedPublicly()) {
6161
throw new Error(`Upload Plugin for attachment field '${this.options.attachments!.attachmentFieldName}' in resource '${this.options.attachments!.attachmentResource}'
62-
should have s3ACL set to 'public-read' (in vast majority of cases signed urls inside of HTML text is not desired behavior, so we did not implement it)`);
62+
uses adapter which is not configured to store objects in public way, so it will produce only signed private URLs which can not be used in HTML text of blog posts.
63+
Please configure adapter in such way that it will store objects publicly (e.g. for S3 use 'public-read' ACL).
64+
`);
6365
}
6466
this.uploadPlugin = plugin;
6567
}

0 commit comments

Comments
 (0)