Skip to content

Commit bb4a8b3

Browse files
authored
Merge pull request #8431 from romayalon/romy-access-check-fixes
NC | CLI | Check Access - fix CLI error message
2 parents 5830a39 + 75c0b7f commit bb4a8b3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/manage_nsfs/manage_nsfs_cli_errors.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
/* Copyright (C) 2016 NooBaa */
22
'use strict';
33

4+
const config = require('../../config');
45
const NoobaaEvent = require('../manage_nsfs/manage_nsfs_events_utils').NoobaaEvent;
56

7+
// by default NC_DISABLE_POSIX_MODE_ACCESS_CHECK=true, therefore CLI access check of account/bucket will be based on stat (open file)
8+
// which checks only read permissions.
9+
const CLI_ACCESS_CHECK_PERMISSIONS = config.NC_DISABLE_POSIX_MODE_ACCESS_CHECK ? 'read' : 'read & write';
10+
611
/**
712
* @typedef {{
813
* code?: string,
@@ -327,7 +332,7 @@ ManageCLIError.InvalidBooleanValue = Object.freeze({
327332

328333
ManageCLIError.InaccessibleAccountNewBucketsPath = Object.freeze({
329334
code: 'InaccessibleAccountNewBucketsPath',
330-
message: 'Account should have read & write access to the specified new_buckets_path',
335+
message: `Account should have ${CLI_ACCESS_CHECK_PERMISSIONS} access to the specified new_buckets_path`,
331336
http_code: 400,
332337
});
333338

@@ -435,7 +440,7 @@ ManageCLIError.MalformedPolicy = Object.freeze({
435440

436441
ManageCLIError.InaccessibleStoragePath = Object.freeze({
437442
code: 'InaccessibleStoragePath',
438-
message: 'Bucket owner should have read & write access to the specified bucket storage path',
443+
message: `Bucket owner should have ${CLI_ACCESS_CHECK_PERMISSIONS} access to the specified bucket storage path`,
439444
http_code: 400,
440445
});
441446

0 commit comments

Comments
 (0)