Skip to content

Commit 3a16328

Browse files
committed
Block folder public toggle override
1 parent 8631555 commit 3a16328

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

app/src/controllers/bucket.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,7 @@ const controller = {
361361
userId: userId
362362
};
363363
// Update S3 Policy
364-
await storageService.updatePublic(data).catch((e) => {
365-
log.warn('Failed to apply permission changes to S3 ' + e, { function: 'togglePublic', ...data });
366-
});
364+
await storageService.updatePublic(data);
367365

368366
// Child bucket cannot be non-public when parent is public
369367
const parents = await bucketService.searchParentBuckets(bucket);

app/src/services/storage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ const objectStorageService = {
562562
`coms::${resource}`.startsWith(policy.Sid) &&
563563
`coms::${resource}` !== policy.Sid);
564564
if (parentPolicy) {
565-
throw new Error(`Unable to override Public status set on folder: ${parentPolicy.Resource}`);
565+
return Promise.reject(new Error(`Unable to override Public status set on path: ${parentPolicy.Resource}`));
566566
}
567567
} catch (e) {
568568
log.debug('No existing policy found', { function: 'updatePublic' });

0 commit comments

Comments
 (0)