Skip to content

Commit

Permalink
removed permission from menue item and andded IsDropDown
Browse files Browse the repository at this point in the history
  • Loading branch information
GeeksSpan committed May 17, 2023
1 parent 27eecf0 commit 240d8f3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Olive.Mvc.Microservices/Navigation/Board/BoardMenue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public class BoardMenu
public string Icon { get; set; }

/// <summary>
/// Permissions for acceess management
/// Is it in the drop down list or a seperate button?
/// </summary>
public string Permissions { get; set; }
public bool IsDropDown { get; set; }
}
}
5 changes: 2 additions & 3 deletions Olive.Mvc.Microservices/Navigation/Navigation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,17 @@ protected void Add(string fullPath, string url, string permissions, string icon,
});
}

protected void AddMenu<TController>(string name, string icon = null, string url = null, string desc = null, string permissions = null) where TController : Controller
protected void AddMenu<TController>(string name, string icon = null, string url = null, string desc = null, bool isDropDown = false) where TController : Controller
{
if (url.IsEmpty()) url = Url.Index<TController>();
if (permissions.IsEmpty()) permissions = typeof(TController).GetCustomAttribute<AuthorizeAttribute>()?.Roles;

Add(new BoardMenu
{
Name = name,
Icon = icon,
Url = url,
Body = desc,
Permissions = permissions
IsDropDown = isDropDown
});
}

Expand Down
2 changes: 1 addition & 1 deletion Olive.Mvc.Microservices/Olive.Mvc.Microservices.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Version>3.1.149</Version>
<Version>3.1.150</Version>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 240d8f3

Please sign in to comment.