Set administrators should have the ability t change folder properties for the folder to which they have set admin rights and any of the folders below that level.

This commit is contained in:
Rich 2020-08-06 19:16:59 +00:00
parent da6ecf841b
commit 45894e48a2

View File

@ -994,7 +994,11 @@ namespace Volian.Controls.Library
#region Menu_Properties
// Add Properties to the menu unless at the very 'top' node or on a grouping (partinfo)
// node (RNOs, Steps, Cautions, Notes) or at the step level.
ok = tn.VEObject as FolderInfo != null ? ui.IsAdministrator() : tn.VEObject as DocVersionInfo != null ? (ui.IsAdministrator() || ui.IsSetAdministrator(tn.VEObject as DocVersionInfo)) : (ui.IsAdministrator() || ((tn.VEObject as ItemInfo) != null && (ui.IsSetAdministrator((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion) || ui.IsWriter((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion))));
// B2020-105 Allow Set Administrators to rename folder's (sets of procedures) to which they have been given access.
if( tn.VEObject is FolderInfo) ok = (ui.IsAdministrator() || ui.IsSetAdministrator(tn.VEObject as FolderInfo));
else ok = (tn.VEObject is DocVersionInfo) ? (ui.IsAdministrator() || ui.IsSetAdministrator(tn.VEObject as DocVersionInfo))
: (ui.IsAdministrator() || (tn.VEObject is ItemInfo) && (ui.IsSetAdministrator((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion)
|| ui.IsWriter((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion)));
PartInfo pia = tn.VEObject as PartInfo;
ItemInfo ii = tn.VEObject as ItemInfo;
if (ok)
@ -1276,7 +1280,7 @@ namespace Volian.Controls.Library
if (!di.Exists) di.Create();
string fileName = PEIPath + "\\" + str + "Approved_Rev_" + ri.RevisionNumber.Replace(" ", "_").Replace("\\", "-").Replace("/", "-") +"_" + xd.SelectSingleNode("procedure/content/@number").InnerText.Replace(" ", "_").Replace(@"\u8209?", "-").Replace(@"\u9586?", "_") + ".pxml";
xd.Save(fileName);
FlexibleMessageBox.Show("Approved procedure saved to import file " + fileName, "Creating Export of Approved Procedure", MessageBoxButtons.OK, MessageBoxIcon.Information);
FlexibleMessageBox.Show("Approved procedure saved to import file " + fileName, "Saving TempMod", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
void ApprovedRevision_Click(object sender, EventArgs e)
@ -2803,7 +2807,7 @@ namespace Volian.Controls.Library
// B2020-087 the config for SubSection_Edit was sometimes set even when there wasn't any subsections,
// so make sure it's cleared if there are no existing subsections
SectionConfig sc = _LastItemInfo.MyConfig as SectionConfig;
if (sc != null && sc.SubSection_Edit == "Y" && _LastItemInfo.Sections == null)
if (sc.SubSection_Edit == "Y" && _LastItemInfo.Sections == null)
{
sc.SubSection_Edit = null;
using (Section mysect = Section.Get(_LastItemInfo.ItemID))
@ -3204,7 +3208,7 @@ namespace Volian.Controls.Library
{
// B2020-087 if we deleted the last sub section, then clear the SubSection_Edit in the parent's config
SectionConfig sc = pii.MyConfig as SectionConfig;
if (sc != null && sc.SubSection_Edit == "Y" && pii.Sections == null) // B2020-103: Added null check
if (sc.SubSection_Edit == "Y" && pii.Sections == null)
{
sc.SubSection_Edit = null;
using (Section mysect = Section.Get(pii.ItemID))