diff --git a/docs/en/UI/AspNetCore/Toolbars.md b/docs/en/UI/AspNetCore/Toolbars.md index 5da78afdac..189d0d9c6e 100644 --- a/docs/en/UI/AspNetCore/Toolbars.md +++ b/docs/en/UI/AspNetCore/Toolbars.md @@ -54,16 +54,17 @@ public class MyToolbarContributor : IToolbarContributor You can use the [authorization](../../Authorization.md) to decide whether to add a `ToolbarItem`. -Use the `RequiredPermissionName` property of `ToolbarItem` or manually checking the permissions. - ````csharp -context.Toolbar.Items.Insert(0, new ToolbarItem(typeof(NotificationViewComponent), requiredPermissionName: "MyPermissionName")); - if (await context.IsGrantedAsync("MyPermissionName")) { //...add Toolbar items } ```` +You can use `RequiredPermissionName` as a shortcut. It is also more performant, ABP optimizes the permission check for all the items. + +````csharp +context.Toolbar.Items.Insert(0, new ToolbarItem(typeof(NotificationViewComponent), requiredPermissionName: "MyPermissionName")); +```` This class adds the `NotificationViewComponent` as the first item in the `Main` toolbar. @@ -84,4 +85,4 @@ That's all, you will see the notification icon on the toolbar when you run the a ## IToolbarManager -`IToolbarManager` is used to render the toolbar. It returns the toolbar items by a toolbar name. This is generally used by the [themes](Theming.md) to render the toolbar on the layout. \ No newline at end of file +`IToolbarManager` is used to render the toolbar. It returns the toolbar items by a toolbar name. This is generally used by the [themes](Theming.md) to render the toolbar on the layout.