- Timestamp:
- 03/09/12 17:22:38 (13 years ago)
- Location:
- branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/RunCreation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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.