Exemple #1
0
        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;
                    }
                }
            }
        }
Exemple #2
0
        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();
        }
Exemple #3
0
 private void WriteTableDataAddendum(object addendum)
 {
     if (addendum != null)
     {
         HtmlTagWriter.Value(" (");
         HtmlTagWriter.Value(addendum);
         HtmlTagWriter.Value(") ");
     }
 }
Exemple #4
0
 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();
 }
Exemple #5
0
 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();
 }
Exemple #6
0
        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();
        }
Exemple #7
0
 public void WriteTableDataForBooleanCondition(bool required)
 {
     HtmlTagWriter.Tags.td();
     HtmlTagWriter.Value(required ? "X" : "");
     HtmlTagWriter.Tags.tdEnd();
 }
Exemple #8
0
 public void WriteTableDataForAbstractRoleCondition(AclExpansionAccessConditions accessConditions)
 {
     HtmlTagWriter.Tags.td();
     HtmlTagWriter.Value(accessConditions.IsAbstractRoleRequired ? accessConditions.AbstractRole.DisplayName : "");
     HtmlTagWriter.Tags.tdEnd();
 }