Skip to content

Commit

Permalink
Fixes #951 The condition in the if statement is opposite in Navigatio…
Browse files Browse the repository at this point in the history
…nManager.GetUrl and format class correctly.
  • Loading branch information
agriffard authored and sebastienros committed Oct 3, 2017
1 parent 18276a6 commit 6127d0a
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ private static void Merge(List<MenuItem> items)
{
var source = items[i];
var merged = false;
for (var j = items.Count - 1; j > i ; j--)
for (var j = items.Count - 1; j > i; j--)
{
var cursor = items[j];

// A match is found, add all its items to the source
if(String.Equals(cursor.Text.Name, source.Text.Name, StringComparison.OrdinalIgnoreCase))
if (String.Equals(cursor.Text.Name, source.Text.Name, StringComparison.OrdinalIgnoreCase))
{
merged = true;
foreach (var child in cursor.Items)
Expand Down Expand Up @@ -143,17 +143,18 @@ private List<MenuItem> ComputeHref(List<MenuItem> menuItems, ActionContext actio
}

/// <summary>
///
/// Gets the url.from a menu item url a routeValueDictionary and an actionContext.
/// </summary>
/// <param name="menuItemUrl"></param>
/// <param name="menuItemUrl">The </param>
/// <param name="routeValueDictionary"></param>
/// <param name="actionContext"></param>
/// <returns></returns>
private string GetUrl(string menuItemUrl, RouteValueDictionary routeValueDictionary, ActionContext actionContext)
{
string url;
if (routeValueDictionary == null || routeValueDictionary.Count == 0)
{
if (!String.IsNullOrEmpty(menuItemUrl))
if (String.IsNullOrEmpty(menuItemUrl))
{
return "#";
}
Expand Down Expand Up @@ -197,6 +198,7 @@ private string GetUrl(string menuItemUrl, RouteValueDictionary routeValueDiction
url = appPath + "/" + url;
}
}

return url;
}

Expand All @@ -210,11 +212,11 @@ private List<MenuItem> Reduce(IEnumerable<MenuItem> items, ClaimsPrincipal user)
foreach (var item in items)
{
// TODO: Attach actual user and remove this clause
if(user == null)
if (user == null)
{
filtered.Add(item);
}
else if(!item.Permissions.Any())
else if (!item.Permissions.Any())
{
filtered.Add(item);
}
Expand Down

0 comments on commit 6127d0a

Please sign in to comment.