Example #1
0
        public NewPolicyWizardSpecific(Pool pool)
            : base(pool)
        {
            this.Text = VMGroup <T> .VMPolicyWizardTitle;

            xenTabPagePolicy = new NewPolicyPolicyNamePage(VMGroup <T> .VMPolicyNamePageText, VMGroup <T> .VMPolicyNamePageTextMore,
                                                           VMGroup <T> .VMPolicyNamePageTabName, VMGroup <T> .VMPolicyNamePageTabText, VMGroup <T> .VMPolicyNamePageNameFieldText);
            xenTabPageSnapshotType           = new NewPolicySnapshotTypePageSpecific <T>();
            xenTabPageVMsPage                = new NewVMGroupVMsPage <T>();
            xenTabPageFinish                 = new NewPolicyFinishPage(VMGroup <T> .VMPolicyFinishPageText, VMGroup <T> .VMPolicyFinishPageCheckboxText, VMGroup <T> .VMPolicyFinishPageTitle);
            xenTabPageRBAC                   = new RBACWarningPage();
            xenTabPageVMsPage.Pool           = pool;
            xenTabPageSnapshotFrequency      = new NewPolicySnapshotFrequencyPage();
            xenTabPageSnapshotFrequency.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;
                check = new RBACWarningPage.WizardPermissionCheck(VMGroup <T> .VMPolicyRBACWarning);
                check.AddApiCheck(VMGroup <T> .VMPolicyRBACapiCheck);
                check.Blocking = true;
                xenTabPageRBAC.AddPermissionChecks(xenConnection, check);
                AddPage(xenTabPageRBAC, 0);
            }
            #endregion

            AddPages(xenTabPagePolicy, xenTabPageVMsPage);
            AddPage(xenTabPageSnapshotType);
            AddPages(xenTabPageSnapshotFrequency);

            if (VMGroup <T> .isVMPolicyVMPP)
            {
                xenTabPageArchive      = new NewPolicyArchivePage();
                xenTabPageArchive.Pool = pool;
                AddPage(xenTabPageArchive);

                xenTabPageEmail      = new NewPolicyEmailPage();
                xenTabPageEmail.Pool = pool;
                AddPages(xenTabPageEmail);
            }

            AddPages(xenTabPageFinish);
        }
Example #2
0
        public NewPolicyWizard(Pool pool)
            : base(pool.Connection)
        {
            InitializeComponent();
            Pool = pool;

            this.Text = Messages.VMSS_WIZARD_TITLE;

            xenTabPagePolicy = new NewPolicyPolicyNamePage(Messages.NEW_VMSS_PAGE_TEXT, Messages.NEW_VMSS_PAGE_TEXT_MORE,
                                                           Messages.VMSS_NAME, Messages.VMSS_NAME_TITLE, Messages.VMSS_NAME_FIELD_TEXT);
            xenTabPageSnapshotType           = new NewPolicySnapshotTypePage();
            xenTabPageVMsPage                = new NewVMGroupVMsPage <VMSS>();
            xenTabPageFinish                 = new NewPolicyFinishPage(Messages.VMSS_FINISH_PAGE_TEXT, Messages.VMSS_FINISH_PAGE_CHECKBOX_TEXT, Messages.VMSS_FINISH_TITLE);
            xenTabPageRBAC                   = new RBACWarningPage();
            xenTabPageVMsPage.Pool           = pool;
            xenTabPageSnapshotFrequency      = new NewPolicySnapshotFrequencyPage();
            xenTabPageSnapshotFrequency.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;
                check = new RBACWarningPage.WizardPermissionCheck(Messages.RBAC_WARNING_VMSS);
                check.AddApiCheck("VMSS.async_create");
                check.Blocking = true;
                xenTabPageRBAC.AddPermissionChecks(xenConnection, check);
                AddPage(xenTabPageRBAC, 0);
            }
            #endregion

            AddPages(xenTabPagePolicy, xenTabPageVMsPage);
            AddPage(xenTabPageSnapshotType);
            AddPages(xenTabPageSnapshotFrequency);
            AddPages(xenTabPageFinish);
        }
Example #3
0
        public NewPolicyWizard(Pool pool)
            : base(pool.Connection)
        {
            InitializeComponent();

            xenTabPagePolicy            = new NewPolicyPolicyNamePage();
            xenTabPageSnapshotType      = new NewPolicySnapshotTypePage();
            xenTabPageSnapshotFrequency = new NewPolicySnapshotFrequencyPage();
            xenTabPageVMsPage           = new NewVMGroupVMsPage <VMPP>();
            xenTabPageArchive           = new NewPolicyArchivePage();
            xenTabPageEmail             = new NewPolicyEmailPage();
            xenTabPageFinish            = new NewPolicyFinishPage();
            xenTabPageRBAC = new RBACWarningPage();

            Pool = pool;
            xenTabPageVMsPage.Pool           = pool;
            xenTabPageEmail.Pool             = pool;
            xenTabPageArchive.Pool           = pool;
            xenTabPageSnapshotFrequency.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_VMPP);
                check.AddApiCheck("VMPP.async_create");
                check.Blocking = true;
                xenTabPageRBAC.AddPermissionChecks(xenConnection, check);
                AddPage(xenTabPageRBAC, 0);
            }
            #endregion

            AddPages(xenTabPagePolicy, xenTabPageVMsPage, xenTabPageSnapshotType, xenTabPageSnapshotFrequency,
                     xenTabPageArchive, xenTabPageEmail, xenTabPageFinish);
        }
Example #4
0
        public NewPolicyWizard(Pool pool)
            : base(pool.Connection)
        {
            InitializeComponent();

            xenTabPagePolicy = new NewPolicyPolicyNamePage();
            xenTabPageSnapshotType = new NewPolicySnapshotTypePage();
            xenTabPageSnapshotFrequency = new NewPolicySnapshotFrequencyPage();
            xenTabPageVMsPage = new NewVMGroupVMsPage<VMPP>();
            xenTabPageArchive = new NewPolicyArchivePage();
            xenTabPageEmail = new NewPolicyEmailPage();
            xenTabPageFinish = new NewPolicyFinishPage();
            xenTabPageRBAC = new RBACWarningPage();
            
            Pool = pool;
            xenTabPageVMsPage.Pool = pool;
            xenTabPageEmail.Pool = pool;
            xenTabPageArchive.Pool = pool;
            xenTabPageSnapshotFrequency.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_VMPP);
                check.AddApiCheck("VMPP.async_create");
                check.Blocking = true;
                xenTabPageRBAC.AddPermissionChecks(xenConnection, check);
                AddPage(xenTabPageRBAC, 0);
            }
            #endregion

            AddPages(xenTabPagePolicy, xenTabPageVMsPage, xenTabPageSnapshotType, xenTabPageSnapshotFrequency,
                     xenTabPageArchive, xenTabPageEmail, xenTabPageFinish);
        }