Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/04/17 13:56:38 (7 years ago)
Author:
jkarder
Message:

#2839:

  • worked on hive administrator view
  • updated service clients
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/MenuItems/AdministratorMenuItem.cs

    r14185 r15401  
    2020#endregion
    2121
     22using System;
    2223using System.Collections.Generic;
    23 using HeuristicLab.Clients.Hive;
     24using System.Windows.Forms;
     25using HeuristicLab.Clients.Access;
    2426using HeuristicLab.MainForm;
     27using HeuristicLab.Optimizer;
    2528
    26 namespace HeuristicLab.Optimizer.MenuItems {
    27   public class AdministratorMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItem, IOptimizerUserInterfaceItemProvider {
     29namespace HeuristicLab.Clients.Hive.Administrator {
     30  public class AdministratorMenuItem : MainForm.WindowsForms.MenuItem, IOptimizerUserInterfaceItemProvider {
    2831    public override string Name {
    2932      get { return "&Administrator"; }
    3033    }
     34
    3135    public override IEnumerable<string> Structure {
    3236      get { return new string[] { "&Services", "&Hive" }; }
    3337    }
     38
    3439    public override void Execute() {
    35       MainFormManager.MainForm.ShowContent(HiveAdminClient.Instance);
     40      if (HiveRoles.CheckAdminUserPermissions()) {
     41        MainFormManager.MainForm.ShowContent(HiveAdminClient.Instance);
     42      } else if (!UserInformation.Instance.UserExists) {
     43        MessageBox.Show(
     44          "Couldn't fetch user information from the server." + Environment.NewLine +
     45          "Please verify that you have an existing user and that your user name and password is correct.",
     46          "HeuristicLab Hive Administrator", MessageBoxButtons.OK, MessageBoxIcon.Error);
     47      } else {
     48        MessageBox.Show(
     49          "You do not seem to have the permissions to use the Hive Administrator." + Environment.NewLine +
     50          "If that's not the case or you have any questions please write an email to support@heuristiclab.com",
     51          "HeuristicLab Hive Administrator", MessageBoxButtons.OK, MessageBoxIcon.Error);
     52      }
    3653    }
     54
    3755    public override int Position {
    38       get { return 10000; }
     56      get { return 8000; }
     57    }
     58
     59    public override Keys ShortCutKeys {
     60      get { return Keys.Control | Keys.Shift | Keys.H; }
    3961    }
    4062  }
Note: See TracChangeset for help on using the changeset viewer.