diff --git a/docs/en/Tutorials/Part-8.md b/docs/en/Tutorials/Part-8.md index d8dd4bc5b1..0076a1b07a 100644 --- a/docs/en/Tutorials/Part-8.md +++ b/docs/en/Tutorials/Part-8.md @@ -361,13 +361,10 @@ Then open the `BookStorePermissionDefinitionProvider` in the same project and ad ````csharp var authorsPermission = bookStoreGroup.AddPermission( BookStorePermissions.Authors.Default, L("Permission:Authors")); - authorsPermission.AddChild( BookStorePermissions.Authors.Create, L("Permission:Authors.Create")); - authorsPermission.AddChild( BookStorePermissions.Authors.Edit, L("Permission:Authors.Edit")); - authorsPermission.AddChild( BookStorePermissions.Authors.Delete, L("Permission:Authors.Delete")); ```` diff --git a/docs/en/Tutorials/Part-9.md b/docs/en/Tutorials/Part-9.md index 76d6d9c8d8..dc43a0270e 100644 --- a/docs/en/Tutorials/Part-9.md +++ b/docs/en/Tutorials/Part-9.md @@ -223,17 +223,28 @@ Notice that we've added more keys. They will be used in the next sections. ### Add to the Main Menu -Open the `BookStoreMenuContributor.cs` in the `Menus` folder of the `Acme.BookStore.Web` project and add the following code in the end of the `ConfigureMainMenuAsync` method: +Open the `BookStoreMenuContributor.cs` in the `Menus` folder of the `Acme.BookStore.Web` project and add a new *Authors* menu item under the *Book Store* menu item. The following code (in the `ConfigureMainMenuAsync` method) shows the final code part: ````csharp -if (await context.IsGrantedAsync(BookStorePermissions.Authors.Default)) -{ - bookStoreMenu.AddItem(new ApplicationMenuItem( - "BooksStore.Authors", - l["Menu:Authors"], - url: "/Authors" - )); -} +context.Menu.AddItem( + new ApplicationMenuItem( + "BooksStore", + l["Menu:BookStore"], + icon: "fa fa-book" + ).AddItem( + new ApplicationMenuItem( + "BooksStore.Books", + l["Menu:Books"], + url: "/Books" + ).RequirePermissions(BookStorePermissions.Books.Default) + ).AddItem( // ADDED THE NEW "AUTHORS" MENU ITEM UNDER THE "BOOK STORE" MENU + new ApplicationMenuItem( + "BooksStore.Authors", + l["Menu:Authors"], + url: "/Authors" + ).RequirePermissions(BookStorePermissions.Books.Default) + ) +); ```` ### Run the Application @@ -244,7 +255,7 @@ Run and login to the application. **You can not see the menu item since you don' As you see, the admin role has no *Author Management* permissions yet. Click to the checkboxes and save the modal to grant the necessary permissions. You will see the *Authors* menu item under the *Book Store* in the main menu, after **refreshing the page**: -![bookstore-authors-page](images/bookstore-authors-page.png) +![bookstore-authors-page](images/bookstore-authors-page-2.png) The page is fully working except *New author* and *Actions/Edit* since we haven't implemented them yet. diff --git a/docs/en/Tutorials/images/bookstore-authors-page-2.png b/docs/en/Tutorials/images/bookstore-authors-page-2.png new file mode 100644 index 0000000000..2ec2d42fe2 Binary files /dev/null and b/docs/en/Tutorials/images/bookstore-authors-page-2.png differ