Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hasokeric/d6eec9343056c1d4e6cb316f3a06ee56 to your computer and use it in GitHub Desktop.
Save hasokeric/d6eec9343056c1d4e6cb316f3a06ee56 to your computer and use it in GitHub Desktop.
Ice.Menu.GetRows Post-Processing
// Set Auditor Role Menu Maintenance Items as Readonly
//
// OptionType:
// A = BAQ Report, OptionType S = Sub Menu, I = Menu Item (Program), B = Report Builder Report Link, C = Assembly Dashboard, D = Runtime, N = Process
//
// OptionSubType:
// F = Form T = Tracker M = Maintenance P = Process R = Report E = Entry
//
// Get All Menu Items of type Form, Maintenance or Entry
// that are not marked as readonly already and mark them -ro
// Exclude SysMonitorEntry and FileTransferEntry
var ttMenuRows =
(from m in ttMenu
where (m.OptionType == "I")
&& (m.OptionSubType == "F" || m.OptionSubType == "M" || m.OptionSubType == "E")
&& !m.Arguments.Contains("-ro")
&& (!m.Program.Equals("Ice.UI.SysMonitorEntry.dll") && !m.Program.Equals("Erp.UI.FileTransferEntry.dll"))
select m).ToList();
foreach (var row in ttMenuRows)
{
row.Arguments = "-ro " + row.Arguments;
}
// Get All Menu Items of type Process
// We also mark them as Readonly
// This will allow you to open up let's say Posting Process but you won't be able to submit
var ttMenuProcessRows =
(from m in ttMenu
where (m.MenuType == "PROCESS" || m.OptionSubType == "P")
&& !m.Arguments.Contains("-ro")
select m).ToList();
foreach (var row in ttMenuProcessRows)
{
row.Arguments = "-ro " + row.Arguments;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment