public void WriteTableDataBodyForSingleState(AclExpansionEntry aclExpansionEntry) { if (aclExpansionEntry.AccessControlList is StatelessAccessControlList) { HtmlTagWriter.Value(StatelessAclStateHtmlText); } else { IOrderedEnumerable <StateDefinition> stateDefinitions = GetAllStatesForAclExpansionEntry(aclExpansionEntry); if (!stateDefinitions.Any()) { HtmlTagWriter.Value(AclWithNoAssociatedStatesHtmlText); } else { bool firstElement = true; foreach (StateDefinition stateDefiniton in stateDefinitions) { if (!firstElement) { HtmlTagWriter.Value(", "); } string stateName = _settings.ShortenNames ? stateDefiniton.ShortName() : stateDefiniton.DisplayName; HtmlTagWriter.Value(stateName); firstElement = false; } } } }
private void WriteTableDataForOwningGroupCondition(AclExpansionAccessConditions conditions) { Assertion.IsFalse(conditions.GroupHierarchyCondition == GroupHierarchyCondition.Undefined && conditions.OwningGroup != null); HtmlTagWriter.Tags.td(); HtmlTagWriter.Value(""); // To force <td></td> instead of <td /> var owningGroup = conditions.OwningGroup; if (owningGroup != null) { HtmlTagWriter.Value(owningGroup.DisplayName); } var groupHierarchyCondition = conditions.GroupHierarchyCondition; // Bitwise operation is OK (alas marking GroupHierarchyCondition with [Flags] is not supported). if ((groupHierarchyCondition & GroupHierarchyCondition.Parent) != 0) { HtmlTagWriter.Tags.br(); HtmlTagWriter.Value(AclToolsExpansion.OrItsParents); // or its parents } // Bitwise operation is OK (alas marking GroupHierarchyCondition with [Flags] is not supported). if ((groupHierarchyCondition & GroupHierarchyCondition.Children) != 0) { HtmlTagWriter.Tags.br(); HtmlTagWriter.Value(AclToolsExpansion.OrItsChildren); // or its children } HtmlTagWriter.Tags.tdEnd(); }
private void WriteTableDataAddendum(object addendum) { if (addendum != null) { HtmlTagWriter.Value(" ("); HtmlTagWriter.Value(addendum); HtmlTagWriter.Value(") "); } }
public virtual void WriteTableDataWithRowCount(string value, int rowCount) { WriteTableRowBeginIfNotInTableRow(); HtmlTagWriter.Tags.td(); WriteRowspanAttribute(rowCount); HtmlTagWriter.Value(value); if (_settings.OutputRowCount) { WriteTableDataAddendum(rowCount); } HtmlTagWriter.Tags.tdEnd(); }
public void WriteTableDataForRole(Role role, int rowCount) { WriteTableRowBeginIfNotInTableRow(); HtmlTagWriter.Tags.td(); WriteRowspanAttribute(rowCount); HtmlTagWriter.Value(role.Group.DisplayName); HtmlTagWriter.Value(", "); HtmlTagWriter.Value(role.Position.DisplayName); if (_settings.OutputRowCount) { WriteTableDataAddendum(rowCount); } HtmlTagWriter.Tags.tdEnd(); }
public void WriteTableDataForAccessTypes(AccessTypeDefinition[] accessTypeDefinitions) { var accessTypeDefinitionsSorted = from atd in accessTypeDefinitions orderby atd.DisplayName select atd; HtmlTagWriter.Tags.td(); bool firstElement = true; foreach (AccessTypeDefinition accessTypeDefinition in accessTypeDefinitionsSorted) { if (!firstElement) { HtmlTagWriter.Value(", "); } HtmlTagWriter.Value(accessTypeDefinition.DisplayName); firstElement = false; } HtmlTagWriter.Tags.tdEnd(); }
public void WriteTableDataForBooleanCondition(bool required) { HtmlTagWriter.Tags.td(); HtmlTagWriter.Value(required ? "X" : ""); HtmlTagWriter.Tags.tdEnd(); }
public void WriteTableDataForAbstractRoleCondition(AclExpansionAccessConditions accessConditions) { HtmlTagWriter.Tags.td(); HtmlTagWriter.Value(accessConditions.IsAbstractRoleRequired ? accessConditions.AbstractRole.DisplayName : ""); HtmlTagWriter.Tags.tdEnd(); }