public static NavigationItemBuilder <TItem, TBuilder> ContentIf <TItem, TBuilder>(this NavigationItemBuilder <TItem, TBuilder> item, ActionDetails actionDetail)
            where TItem : NavigationItem <TItem>
            where TBuilder : NavigationItemBuilder <TItem, TBuilder>, IHideObjectMembers
        {
            SmartPrincipal user = item.ViewContext.HttpContext.User as SmartPrincipal;

            if ((actionDetail != null))
            {
                if (user.IsInFeature(actionDetail.Feature))
                {
                    return(item.Content(actionDetail.Content));
                }
            }

            item.Visible(false);
            return(item);
        }
        public static NavigationItemBuilder <TItem, TBuilder> ActionIf <TItem, TBuilder>(this NavigationItemBuilder <TItem, TBuilder> item, ActionDetails[] actionDetails)
            where TItem : NavigationItem <TItem>
            where TBuilder : NavigationItemBuilder <TItem, TBuilder>, IHideObjectMembers
        {
            SmartPrincipal user = item.ViewContext.HttpContext.User as SmartPrincipal;

            if ((actionDetails != null) && (actionDetails.Length > 0))
            {
                foreach (ActionDetails actionDetail in actionDetails)
                {
                    if (user.IsInFeature(actionDetail.Feature))
                    {
                        return(item.Action(actionDetail.Action, actionDetail.Controller));
                    }
                }
            }

            item.Visible(true);
            return(item);
        }