Ejemplo n.º 1
0
 private void Init(WebNavigationItemDefinition navItem)
 {
     _navItem       = navItem;
     Name           = _navItem.Name;
     DisplayName    = _navItem.DisplayName;
     HasPermissions = navItem.HasPermissions != null ? navItem.HasPermissions : new Permission[] { };
     Items          = new List <UserNavigationItem>();
     IsVisible      = navItem.IsVisible;
     Order          = 0;
     NavigationType = navItem.NavigationType;
     MenuType       = navItem.MenuType;
 }
        private UserNavigationItem CreateUserNavItem(IUserIdentifier user, WebNavigationItemDefinition webNavItem)
        {
            var userNavItem = new UserNavigationItem(webNavItem);

            //var hasPermissions = new List<Permission>();
            //foreach (var hasPermission in userNavItem.HasPermissions)
            //{
            //    if (await _authorizationService.TryCheckAccess(webNavItem.HasPermissions,
            //        userNavItem.RequiresAuthentication, user))
            //        hasPermissions.Add(hasPermission);
            //}

            //userNavItem.HasPermissions = hasPermissions.ToArray();
            return(userNavItem);
        }
Ejemplo n.º 3
0
 public UserNavigationItem(WebNavigationItemDefinition navItem)
 {
     Init(navItem);
 }