|
@@ -56,6 +56,11 @@ public class StandardSyncAccountService implements SyncAccountService { |
|
|
if (installType == AnsibleInstallType.sage) { |
|
|
if (installType == AnsibleInstallType.sage) { |
|
|
// changing account on sage, notify all bubbles launched by user that have syncAccount == true |
|
|
// changing account on sage, notify all bubbles launched by user that have syncAccount == true |
|
|
|
|
|
|
|
|
|
|
|
// sync account: sage -> node(s) |
|
|
|
|
|
// Note that a non-admin person can change only his own account on sage node, while admin can change any |
|
|
|
|
|
// account. In both cases, the change should be synced through the nodes, so even for non-admin account, the |
|
|
|
|
|
// sync should be done here. |
|
|
|
|
|
|
|
|
for (BubbleNetwork network : networkDAO.findByAccount(account.getUuid())) { |
|
|
for (BubbleNetwork network : networkDAO.findByAccount(account.getUuid())) { |
|
|
if (network.getState() != BubbleNetworkState.running) continue; |
|
|
if (network.getState() != BubbleNetworkState.running) continue; |
|
|
if (!network.syncAccount()) continue; |
|
|
if (!network.syncAccount()) continue; |
|
@@ -70,6 +75,11 @@ public class StandardSyncAccountService implements SyncAccountService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} else if (installType == AnsibleInstallType.node) { |
|
|
} else if (installType == AnsibleInstallType.node) { |
|
|
|
|
|
// sync account: node -> sage |
|
|
|
|
|
// On sage there's just a single account related to this node - the node's network owner's account. So only |
|
|
|
|
|
// that account should be synced in this case. It doesn't matter if somebody already changed this account |
|
|
|
|
|
// to be non-admin (TODO strange situation and maybe it should be tested if it is forbidden already) |
|
|
|
|
|
|
|
|
if (account.getUuid().equals(thisNetwork.getAccount())) { |
|
|
if (account.getUuid().equals(thisNetwork.getAccount())) { |
|
|
log.info("sync: not syncing non-owner account from node to sage"); |
|
|
log.info("sync: not syncing non-owner account from node to sage"); |
|
|
return; |
|
|
return; |
|
|