示例#1
0
        public NewVMApplianceWizard(Pool pool)
            : base(pool.Connection)
        {
            InitializeComponent();

            xenTabPageRBAC             = new RBACWarningPage();
            xenTabPageVMs              = new NewVMGroupVMsPage <VM_appliance>();
            xenTabPageName             = new NewVMApplianceNamePage();
            xenTabPageFinish           = new NewVMApplianceFinishPage();
            xenTabPageVMOrderAndDelays = new NewVMApplianceVMOrderAndDelaysPage();

            Pool = pool;
            xenTabPageVMs.Pool = pool;

            #region RBAC Warning Page Checks
            if (Pool.Connection.Session.IsLocalSuperuser || Helpers.GetMaster(Pool.Connection).external_auth_type == Auth.AUTH_TYPE_NONE)
            {
                //do nothing
            }
            else
            {
                RBACWarningPage.WizardPermissionCheck check = new RBACWarningPage.WizardPermissionCheck(Messages.RBAC_WARNING_VM_APPLIANCE);
                check.AddApiCheck("VM_appliance.async_create");
                check.Blocking = true;
                xenTabPageRBAC.AddPermissionChecks(xenConnection, check);
                AddPage(xenTabPageRBAC, 0);
            }
            #endregion

            xenTabPageVMOrderAndDelays.Pool = pool;
            AddPages(xenTabPageName, xenTabPageVMs, xenTabPageVMOrderAndDelays, xenTabPageFinish);
        }
示例#2
0
        public NewVMApplianceWizard(Pool pool)
            : base(pool.Connection)
        {
            InitializeComponent();

            xenTabPageRBAC = new RBACWarningPage();
            xenTabPageVMs = new NewVMGroupVMsPage<VM_appliance>();
            xenTabPageName = new NewVMApplianceNamePage();
            xenTabPageFinish = new NewVMApplianceFinishPage();
            xenTabPageVMOrderAndDelays = new NewVMApplianceVMOrderAndDelaysPage();
            
            Pool = pool;
            xenTabPageVMs.Pool = pool;

            #region RBAC Warning Page Checks
            if (Pool.Connection.Session.IsLocalSuperuser || Helpers.GetMaster(Pool.Connection).external_auth_type == Auth.AUTH_TYPE_NONE)
            {
                //do nothing
            }
            else
            {
                RBACWarningPage.WizardPermissionCheck check = new RBACWarningPage.WizardPermissionCheck(Messages.RBAC_WARNING_VM_APPLIANCE); 
                check.AddApiCheck("VM_appliance.async_create");
                check.Blocking = true;
                xenTabPageRBAC.AddPermissionChecks(xenConnection, check);
                AddPage(xenTabPageRBAC, 0);
            }
            #endregion

            xenTabPageVMOrderAndDelays.Pool = pool;
            AddPages(xenTabPageName, xenTabPageVMs, xenTabPageVMOrderAndDelays, xenTabPageFinish);
        }