toolbar applied on TenantManagement

pull/6575/head
Ahmet 5 years ago
parent bc7eb4296f
commit 7438f3b833

@ -2,8 +2,10 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.PageToolbars;
using Volo.Abp.AutoMapper;
using Volo.Abp.FeatureManagement;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.ObjectExtending;
using Volo.Abp.ObjectExtending.Modularity;
@ -61,6 +63,28 @@ namespace Volo.Abp.TenantManagement.Web
options.Conventions.AuthorizePage("/TenantManagement/Tenants/EditModal", TenantManagementPermissions.Tenants.Update);
options.Conventions.AuthorizePage("/TenantManagement/Tenants/ConnectionStrings", TenantManagementPermissions.Tenants.ManageConnectionStrings);
});
Configure<AbpPageToolbarOptions>(options =>
{
options.Configure<Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants.IndexModel>(
toolbar =>
{
toolbar.AddButton(
LocalizableString.Create<AbpTenantManagementResource>("ManageHostFeatures"),
icon: "cog",
name: "ManageHostFeatures",
requiredPolicyName: FeatureManagementPermissions.ManageHostFeatures
);
toolbar.AddButton(
LocalizableString.Create<AbpTenantManagementResource>("NewTenant"),
icon: "plus",
name: "CreateTenant",
requiredPolicyName: TenantManagementPermissions.Tenants.Create
);
}
);
});
}
public override void PostConfigureServices(ServiceConfigurationContext context)

@ -2,6 +2,7 @@
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Pages.Shared.Components.AbpPageToolbar
@using Volo.Abp.FeatureManagement
@using Volo.Abp.TenantManagement
@using Volo.Abp.TenantManagement.Localization
@ -30,14 +31,7 @@
<abp-card-title>@L["Tenants"]</abp-card-title>
</abp-column>
<abp-column size-md="_6" class="text-right">
@if (await Authorization.IsGrantedAsync(FeatureManagementPermissions.ManageHostFeatures))
{
<abp-button button-type="Primary" name="ManageHostFeatures" icon="cog" text="@L["ManageHostFeatures"].Value" />
}
@if (await Authorization.IsGrantedAsync(TenantManagementPermissions.Tenants.Create))
{
<abp-button button-type="Primary" name="CreateTenant" icon="plus" text="@L["NewTenant"].Value"/>
}
@await Component.InvokeAsync(typeof(AbpPageToolbarViewComponent), new { pageName = typeof(IndexModel).FullName })
</abp-column>
</abp-row>
</abp-card-header>

Loading…
Cancel
Save