private string GetParentGroups(string identityName, bool directOnly) { var identityId = Id(identityName); var result = CurrentContext.Security.GetParentGroups(identityId, directOnly); return(String.Join(", ", result.Select(i => Tools.IdToName(i)).OrderBy(s => s))); }
private string GetAllowedUsers(string entityName, params string[] permissions) { var entityId = Id(entityName); var permTypes = permissions.Select(p => _permissions[p]).ToArray(); var result = CurrentContext.Security.GetAllowedUsers(entityId, permTypes); return(String.Join(", ", result.Select(i => Tools.IdToName(i)).OrderBy(s => s))); }
internal static string ReplaceIds(string src) { int p = src.IndexOf('('); while (p >= 0) { var p1 = src.IndexOf(')', p); var s = src.Substring(p + 1, p1 - p - 1); var id = int.Parse(s); var name = Tools.IdToName(id); src = string.Concat(src.Substring(0, p), name, src.Substring(p1 + 1)); p = src.IndexOf('('); } return(src); }