Changeset 7592
- Timestamp:
- 03/09/12 17:22:38 (13 years ago)
- Location:
- branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/Administration/AdministratorMenuItem.cs
r7331 r7592 21 21 22 22 using System.Collections.Generic; 23 using System.Windows.Forms; 23 24 using HeuristicLab.MainForm; 24 25 using HeuristicLab.Optimizer; … … 37 38 38 39 public override void Execute() { 39 MainFormManager.MainForm.ShowContent(AdministrationClient.Instance); 40 if (OKBRoles.CheckAdminUserPermissions()) { 41 MainFormManager.MainForm.ShowContent(AdministrationClient.Instance); 42 } else { 43 MessageBox.Show("You don't have the permissions for administrating the OKB.", "Security check failed", MessageBoxButtons.OK, MessageBoxIcon.Warning); 44 } 40 45 } 41 46 } -
branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/HeuristicLab.Clients.OKB-3.3.csproj
r7589 r7592 202 202 <DependentUpon>ProblemView.cs</DependentUpon> 203 203 </Compile> 204 <Compile Include="OKBRoles.cs" /> 204 205 <Compile Include="Plugin.cs" /> 205 206 <Compile Include="Query\QueryClient.cs" /> -
branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/RunCreation/CreateFromExperimentMenuItem.cs
r7580 r7592 40 40 protected override void OnActiveViewChanged(object sender, EventArgs e) { 41 41 IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView; 42 ToolStripItem.Enabled = (activeView != null) && (activeView.Content != null) && (activeView.Content is Experiment) && !activeView.Locked ;42 ToolStripItem.Enabled = (activeView != null) && (activeView.Content != null) && (activeView.Content is Experiment) && !activeView.Locked && OKBRoles.CheckUserPermissions(); 43 43 } 44 44 -
branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/RunCreation/OKBAlgorithm.cs
r7554 r7592 200 200 runs = new RunCollection(); 201 201 storeRunsAutomatically = true; 202 UserId = UserInformation.Instance.User.Id;202 CheckUserPermissions(); 203 203 RegisterRunsEvents(); 204 } 205 206 private void CheckUserPermissions() { 207 if (UserInformation.Instance.UserExists) { 208 if (UserInformation.Instance.Roles.Count(x => x.Name == OKBRoles.OKBUser || x.Name == OKBRoles.OKBAdministrator) > 0) { 209 UserId = UserInformation.Instance.User.Id; 210 } else { 211 throw new Exception("You don't have the appropriate roles for executing OKB Algorithms."); 212 } 213 } else { 214 throw new Exception("You need an user account for executing OKB Algorithms."); 215 } 204 216 } 205 217
Note: See TracChangeset
for help on using the changeset viewer.