Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/18/12 21:32:36 (12 years ago)
Author:
ascheibe
Message:

#1648 display an error message if a user lacks the appropriate roles for the user administration

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Clients.Access.Administration/3.3/MenuItems/UserAdministrationMenuItem.cs

    r8042 r8043  
    2020#endregion
    2121
     22using System;
    2223using System.Collections.Generic;
     24using System.Linq;
     25using System.Windows.Forms;
    2326using HeuristicLab.Optimizer;
    2427
     
    3235    }
    3336    public override void Execute() {
    34       using (UserAdministrationDialog dialog = new UserAdministrationDialog()) {
    35         dialog.ShowDialog();
     37      if (UserInformation.Instance.User.Roles.Where(x => x.Name == UserInformation.AdministratorRoleName).Count() > 0) {
     38        using (UserAdministrationDialog dialog = new UserAdministrationDialog()) {
     39          dialog.ShowDialog();
     40        }
     41      } else {
     42        MessageBox.Show("You do not seem to have the permissions to use the Access Service Administrator." + Environment.NewLine +
     43        "If that's not the case or you have any questions please write an email to support@heuristiclab.com",
     44        "Access Service Administrator", MessageBoxButtons.OK, MessageBoxIcon.Error);
    3645      }
    3746    }
Note: See TracChangeset for help on using the changeset viewer.