Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ private void destroyKubernetesClusterNetwork() throws ManagementServerException
if (network != null && network.getRemoved() == null) {
Account owner = accountManager.getAccount(network.getAccountId());
User callerUser = accountManager.getActiveUser(CallContext.current().getCallingUserId());
ReservationContext context = new ReservationContextImpl(null, null, callerUser, owner);
ReservationContext context = new ReservationContextImpl(null, null, callerUser, CallContext.current().getCallingAccount());
releaseASNumber(kubernetesCluster.getZoneId(), kubernetesCluster.getNetworkId());
boolean networkDestroyed = networkMgr.destroyNetwork(kubernetesCluster.getNetworkId(), context, true);
if (!networkDestroyed) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2924,7 +2924,7 @@ public boolean deleteNetwork(long networkId, boolean forced) {
}

User callerUser = _accountMgr.getActiveUser(CallContext.current().getCallingUserId());
ReservationContext context = new ReservationContextImpl(null, null, callerUser, owner);
ReservationContext context = new ReservationContextImpl(null, null, callerUser, caller);

return _networkMgr.destroyNetwork(networkId, context, forced);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2851,7 +2851,7 @@ protected boolean deletePrivateGatewayFromTheDB(final PrivateGateway gateway) {
if (deleteNetworkFinal) {
final User callerUser = _accountMgr.getActiveUser(CallContext.current().getCallingUserId());
final Account owner = _accountMgr.getAccount(Account.ACCOUNT_ID_SYSTEM);
final ReservationContext context = new ReservationContextImpl(null, null, callerUser, owner);
final ReservationContext context = new ReservationContextImpl(null, null, callerUser, CallContext.current().getCallingAccount());

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason to change this one too? it already used the system account so it never hit the disabled account problem, and now a normal user deleting the gateway could fail the permission checks

_ntwkMgr.destroyNetwork(networkId, context, false);
logger.debug("Deleted private network {}", network);
}
Expand Down
Loading