private static void RemoveCmdletParams(RoleEntryInfo entry, IList <string> paramList, IList <RoleEntryInfo> cmdletTobeRemoved, IList <RoleEntryInfo> cmdletTobeAdded, bool fNewCmdlet) { if (paramList == null || paramList.Count == 0) { return; } if (cmdletTobeRemoved == null) { return; } if (cmdletTobeAdded == null) { return; } cmdletTobeRemoved.Add(entry); IEnumerable <string> source = entry.RoleEntry.Parameters.Except(paramList); RoleEntryInfo roleEntryInfo; if (entry.RoleAssignment == null) { roleEntryInfo = new RoleEntryInfo(entry.RoleEntry.Clone(source.ToList <string>())); } else { roleEntryInfo = new RoleEntryInfo(entry.RoleEntry.Clone(source.ToList <string>()), entry.RoleAssignment); } roleEntryInfo.ScopeSet = entry.ScopeSet; cmdletTobeAdded.Add(roleEntryInfo); if (fNewCmdlet) { AuthZLogger.SafeAppendColumn(RpsAuthZMetadata.CmdletFlightDisabled, entry.RoleEntry.Name, string.Join(" ", paramList)); } }
private static void RemoveCmdlet(RoleEntryInfo entry, IList <RoleEntryInfo> cmdletTobeRemoved, bool fNewCmdlet) { cmdletTobeRemoved.Add(entry); if (fNewCmdlet) { AuthZLogger.SafeAppendColumn(RpsAuthZMetadata.CmdletFlightDisabled, entry.RoleEntry.Name, "*"); } }
private static void BuildParamFlightingList(RoleEntryInfo entry, ICmdletSettings cmdletSettings, ref IList <string> paramFlightingList) { IEnumerable <string> enumerable = cmdletSettings.Params0.Union(cmdletSettings.Params1); enumerable = enumerable.Union(cmdletSettings.Params2); enumerable = enumerable.Union(cmdletSettings.Params3); enumerable = enumerable.Union(cmdletSettings.Params4); enumerable = enumerable.Union(cmdletSettings.Params5); enumerable = enumerable.Union(cmdletSettings.Params6); enumerable = enumerable.Union(cmdletSettings.Params7); enumerable = enumerable.Union(cmdletSettings.Params8); enumerable = enumerable.Union(cmdletSettings.Params9); if (enumerable != null) { paramFlightingList = enumerable.ToList <string>(); AuthZLogger.SafeAppendColumn(RpsAuthZMetadata.CmdletFlightEnabled, entry.RoleEntry.Name, string.Join(" ", paramFlightingList)); } }