diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/MultiUserExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/MultiUserExt.cs index 99c0108c..5a741d6d 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/MultiUserExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/MultiUserExt.cs @@ -1232,6 +1232,11 @@ namespace VEPROMS.CSLA.Library } return false; } + // B2018-112 added for easy check if user's PROMS Security allows making edits - used in StepTabRibbon - SetButtonAndMenuEnabling() + public bool IsAllowedToEdit(DocVersionInfo dvi) + { + return IsAdministrator() || IsSetAdministrator(dvi) || IsWriter(dvi); + } public static UserInfo GetByUserID(string userID) { try diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs index 97bbbf45..e0710122 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs @@ -1490,7 +1490,7 @@ namespace Volian.Controls.Library if (!MyItemInfo.IsEnhancedStep && !MyItemInfo.IsEnhancedSection && (((MyItemInfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds) || ((MyItemInfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedDeviations) == E_PurchaseOptions.EnhancedDeviations))) - SetButtonEnablingForEnhanced(true); + SetButtonEnablingForEnhanced(MyUserInfo.IsAllowedToEdit(dvi)); // B2018-112 - set context menu and ribbon buttons based on user's PROMS Security setting if (dvi.VersionType > 127 || MyEditItem.MyStepPanel.VwMode == E_ViewMode.View) { @@ -1629,7 +1629,7 @@ namespace Volian.Controls.Library bool allowDel = false; EnhancedDocuments eds = MyItemInfo.GetMyEnhancedDocuments(); // note in follow if statements, 'setting' == false when in enhanced document: - if (!setting && MyItemInfo.IsStep && (eds == null || eds.Count == 0)) // this step is in enhanced, but not linked + if (setting && MyItemInfo.IsStep && (eds == null || eds.Count == 0)) // this step is in enhanced, but not linked // B2018-112 and is allowed to edit allowDel = true; // allow delete if not linked btnCpyStp.Enabled = setting; //B20170-158 Allow a Unlinked Step to be pasted before or after a linked step.