Skip to content

Commit

Permalink
Restored RBAC check on source connection.
Browse files Browse the repository at this point in the history
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
  • Loading branch information
kc284 authored and danilo-delbusso committed Nov 24, 2021
1 parent a327390 commit 89620bf
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ protected override void UpdateWizardContent(XenTabPage page)
RemovePage(m_pageTransferNetwork);
RemovePage(m_pageTargetRbac);
m_vmMappings = m_pageDestination.VmMappings;
TargetConnection = m_pageDestination.ChosenItem == null ? null : m_pageDestination.ChosenItem.Connection;
TargetConnection = m_pageDestination.ChosenItem?.Connection;
m_pageStorage.TargetConnection = TargetConnection;
m_pageNetwork.TargetConnection = TargetConnection;

Expand Down Expand Up @@ -428,6 +428,17 @@ protected override void UpdateWizardContent(XenTabPage page)
{
RemovePagesFrom(1);
AddAfterPage(m_pageCopyMode, m_pageDestination, m_pageStorage, m_pageFinish);
if (Helpers.ConnectionRequiresRbac(xenConnection))
{
var message = m_vmMappings.Any(IsTemplate)
? Messages.RBAC_CROSS_POOL_COPY_TEMPLATE_BLOCKED
: Messages.RBAC_CROSS_POOL_COPY_VM_BLOCKED;

m_pageTargetRbac.SetPermissionChecks(new List<IXenConnection> {xenConnection},
new WizardRbacCheck(message, VMCrossPoolMigrateAction.StaticRBACDependencies) {Blocking = true});

AddAfterPage(m_pageCopyMode, m_pageTargetRbac);
}
}
}
if (type != typeof(CrossPoolMigrateFinishPage))
Expand Down

0 comments on commit 89620bf

Please sign in to comment.