From a6b8572201fd02a0f25db61b624a1489177c7038 Mon Sep 17 00:00:00 2001
From: Aleksandr Gorodetskii
<41908792+AleksandrGorodetskii@users.noreply.github.com>
Date: Fri, 27 Oct 2023 14:23:52 +0300
Subject: [PATCH] GUI Storage admin role (#3389): add storage admin role
(#3392)
* GUI Storage admin role (#3389): add storage admin role
* GUI Storage admin role (#3389): restrict grant user permissions search input to minimum 3 character length
* GUI Storage admin role (#3389): grant user permissions search input - fix placeholder
* GUI Storage admin role (#3389): small fixes
* GUI Storage admin role (#3389): grant user permissions search input - style adjustments
---
.../components/pipelines/browser/Folder.js | 29 +++--
.../pipelines/browser/data-storage/index.js | 14 +-
.../browser/forms/DataStorageEditDialog.js | 37 +++---
.../components/roleModel/PermissionsForm.js | 121 ++++++++++--------
.../components/settings/UserManagementForm.js | 2 +-
client/src/utils/roleModel.js | 2 +
6 files changed, 118 insertions(+), 87 deletions(-)
diff --git a/client/src/components/pipelines/browser/Folder.js b/client/src/components/pipelines/browser/Folder.js
index fa960751db..149cede3c0 100644
--- a/client/src/components/pipelines/browser/Folder.js
+++ b/client/src/components/pipelines/browser/Folder.js
@@ -68,7 +68,7 @@ import ConfigurationDelete from '../../../models/configuration/ConfigurationDele
import CreateDataStorage from '../../../models/dataStorage/DataStorageSave';
import UpdateDataStorage from '../../../models/dataStorage/DataStorageUpdate';
import DataStorageUpdateStoragePolicy
- from '../../../models/dataStorage/DataStorageUpdateStoragePolicy';
+from '../../../models/dataStorage/DataStorageUpdateStoragePolicy';
import DataStorageDelete from '../../../models/dataStorage/DataStorageDelete';
import {METADATA_KEYS} from './metadata-controls/get-default-metadata-properties';
import Metadata, {SpecialTags} from '../../special/metadata/Metadata';
@@ -519,7 +519,10 @@ export default class Folder extends localization.LocalizedReactComponent {
}
break;
case ItemTypes.storage:
- if (roleModel.writeAllowed(item)) {
+ if (
+ roleModel.isManager.storageAdmin(this) ||
+ roleModel.writeAllowed(item)
+ ) {
actions.push(
}
@@ -1563,7 +1569,9 @@ export default class Folder extends localization.LocalizedReactComponent {
);
}
}
- if (roleModel.isManager.storage(this)) {
+ if (roleModel.isManager.storage(this) ||
+ (roleModel.isManager.storageAdmin(this) && roleModel.writeAllowed(this.props.folder.value))
+ ) {
const fsMountsAvailable = this.props.awsRegions.loaded &&
extractFileShareMountList(this.props.awsRegions.value).length > 0;
createActions.push(
@@ -1864,12 +1872,15 @@ export default class Folder extends localization.LocalizedReactComponent {
);
}
if (
- !this.props.readOnly &&
- roleModel.writeAllowed(this.props.folder.value) &&
- roleModel.isManager.folder(this)
+ !this.props.readOnly && (
+ roleModel.isManager.storageAdmin(this) || (
+ roleModel.writeAllowed(this.props.folder.value) &&
+ roleModel.isManager.folder(this)
+ )
+ )
) {
if (editActions.length > 0) {
- editActions.push();
+ editActions.push();
}
editActions.push(