public void GetNavigation(NavigationBuilder builder) { builder.Add(item => item .Caption(T("Territories")) .Position("3") .LinkToFirstChild(false) .Add(subItem => { subItem = subItem .Caption(T("Hierarchies")) .Position("1") .Action("Index", "TerritoryHierarchiesAdmin", new { area = "Nwazet.Commerce" }) .Permission(TerritoriesPermissions.ManageTerritoryHierarchies); foreach (var permission in _permissionProvider.ListHierarchyTypePermissions()) { subItem = subItem.Permission(permission); } }) .Add(subItem => subItem .Caption(T("Territories")) .Position("2") .Action("TerritoriesIndex", "TerritoriesAdmin", new { area = "Nwazet.Commerce" }) .Permission(TerritoriesPermissions.ManageInternalTerritories) ) ); }
public void HierarchyManagePermissionsAreSameNumberAsHierarchyTypesForUserWithAllPermissions() { Assert.That(_territoriesService.GetHierarchyTypes().Count(), Is.EqualTo(3)); Assert.That(_permissionProvider.ListHierarchyTypePermissions().Count(), Is.EqualTo(3)); }