Skip to content

Commit

Permalink
fix(Accounts/Create): use 'inherit_acl=false' only if parent is 'root…
Browse files Browse the repository at this point in the history
…' [YTFRONT-4561]
  • Loading branch information
ma-efremoff committed Dec 18, 2024
1 parent 1e00b7a commit 0a59da8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/ui/src/ui/utils/accounts/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import reduce_ from 'lodash/reduce';

import yt from '@ytsaurus/javascript-wrapper/lib/yt';

import {ROOT_ACCOUNT_NAME} from '../../constants/accounts/accounts';
import {EDITOR_TABS} from '../../constants/accounts/editor';
import hammer from '../../common/hammer';
import {Toaster} from '@gravity-ui/uikit';
Expand All @@ -16,12 +17,13 @@ const toaster = new Toaster();
const ERRRO_TOASTER_TIMEOUT = 10000;
const SUCCESS_TOASTER_TIMEOUT = 5000;

export function setResponsibleUsers(cluster, users, accountName) {
export function setResponsibleUsers(cluster, users, accountName, inheritAcl) {
const path = accountName;

return updateAcl(cluster, path, {
idmKind: IdmObjectType.ACCOUNT,
responsible: users,
inheritAcl,
});
}

Expand All @@ -40,7 +42,12 @@ export function createAccountFromInfo(cluster, newAccountInfo) {
return Promise.all([
setAccountAbc(account, id, slug).catch(() => {}),
createHome ? createAccountHome(account).catch(() => {}) : Promise.resolve(),
setResponsibleUsers(cluster, responsibles, account).catch(() => {}),
setResponsibleUsers(
cluster,
responsibles,
account,
parentAccount !== ROOT_ACCOUNT_NAME,
).catch(() => {}),
]);
});
};
Expand Down

0 comments on commit 0a59da8

Please sign in to comment.