public virtual MenuItemState DetermineStateFor(MenuNode node) { if (node.BehaviorChain == null) { return(MenuItemState.Available); } var rights = _authorizor.Authorize(node.BehaviorChain, node.UrlInput); if (rights != AuthorizationRight.Allow) { return(node.UnauthorizedState); } if (_current.OriginatingChain == node.BehaviorChain) { return(MenuItemState.Active); } if (_conditionals.IsTrue(node.HideIfConditional)) { return(MenuItemState.Hidden); } if (_conditionals.IsTrue(node.IsEnabledBy())) { return(MenuItemState.Available); } return(MenuItemState.Disabled); }
protected override Endpoint createResult(object model, BehaviorChain chain) { return(new Endpoint() { IsAuthorized = _authorizor.Authorize(chain, model) == AuthorizationRight.Allow, Url = chain.Route.CreateUrlFromInput(model).ToAbsoluteUrl() }); }
protected override Endpoint createResult(object model, BehaviorChain chain) { var urlFromInput = chain.Route.CreateUrlFromInput(model); return(new Endpoint { IsAuthorized = _authorizor.Authorize(chain, model) == AuthorizationRight.Allow, Url = _httpRequest.ToFullUrl(urlFromInput) }); }
protected override Endpoint createResult(object model, BehaviorChain chain) { var url = _urlResolver.UrlFor(model, chain); return(new Endpoint { IsAuthorized = _authorizor.Authorize(chain, model) == AuthorizationRight.Allow, Url = url, Chain = chain }); }
protected override AuthorizationRight createResult(object model, BehaviorChain chain) { return(_authorizor.Authorize(chain, model)); }