現在、承認が必要Controller
なIndex()
アクション メソッドがあります。
public partial class CustomerController : BaseDocumentStoreController
{
[Authorize(Roles = AccountController.Administrator)]
public virtual ViewResult Index()
{
...
}
...
}
Mvc.sitemap
これを配置すると、パンくずリストにそれぞれのノードが表示されなくなります。
<mvcSiteMapNode title="Customer" controller="Customer" action="Index"
resourceKey="Customers" clickable="true" >
<mvcSiteMapNode title="Customer Add" controller="Customer" action="Add"
resourceKey="Add" />
<mvcSiteMapNode title="Customer Create" controller="Customer" action="Create"
resourceKey="Add" />
<mvcSiteMapNode title="Customer Edit" controller="Customer" action="Edit"
resourceKey="Edit" />
<mvcSiteMapNode title="Customer Update" controller="Customer" action="Update"
resourceKey="Edit" />
<mvcSiteMapNode title="Customer Delete" controller="Customer" action="Delete"
resourceKey="Delete" />
<mvcSiteMapNode title="Customer Details" controller="Customer" action="Details"
resourceKey="Details" />
<mvcSiteMapNode title="Customer Search" controller="Customer" action="Search"
resourceKey="Search" />
</mvcSiteMapNode>
私が欲しいのは、とにかくこのノードを表示することです...
ユーザーが認証されていないとしましょう。だから私はブレッドクラムにこれを表示したい:
Home > Customers > Add
現在、以下のみが表示されます:
Add
ユーザーがCustomersノードをクリックすると、ログイン ビューにリダイレクトされます。
SiteMapVisibilityProvider
次の手順に従って、独自の実装を試みました。
public class SiteMapVisibilityProvider : ISiteMapNodeVisibilityProvider
{
...
}
デバッグ中、Index ノードの下にあるノードしか表示されませんでした。つまり、現在のケースでは、Add ノードだけが表示されていました。Index アクション メソッドを表すノードがデバッグ セッションに表示されませんでした。
私が望むものを達成する方法はありますか?