diff --git a/src/AbpDesk/AbpDesk.EntityFrameworkCore/AbpDesk/EntityFrameworkCore/AbpDeskDbConfigurer.cs b/src/AbpDesk/AbpDesk.EntityFrameworkCore/AbpDesk/EntityFrameworkCore/AbpDeskDbConfigurer.cs index 861f0f2341..ec24dc1ecf 100644 --- a/src/AbpDesk/AbpDesk.EntityFrameworkCore/AbpDesk/EntityFrameworkCore/AbpDeskDbConfigurer.cs +++ b/src/AbpDesk/AbpDesk.EntityFrameworkCore/AbpDesk/EntityFrameworkCore/AbpDeskDbConfigurer.cs @@ -18,6 +18,10 @@ namespace AbpDesk.EntityFrameworkCore //Configures all dbcontextes to use Sql Server with calculated connection string options.Configure(context => { + //TODO: Create an extension method to AbpDbContextConfigurationContext to use SqlServer in single line call! Example: + /* context.UseSqlServer(opional action to configure sqlserver) + * This internally makes the if below! + */ if (context.ExistingConnection != null) { context.DbContextOptions.UseSqlServer(context.ExistingConnection); diff --git a/src/Volo.Abp.Permissions.Web/AbpPermissionsWebAutoMapperProfile.cs b/src/Volo.Abp.Permissions.Web/AbpPermissionsWebAutoMapperProfile.cs index 4acafa424b..7df4bbc938 100644 --- a/src/Volo.Abp.Permissions.Web/AbpPermissionsWebAutoMapperProfile.cs +++ b/src/Volo.Abp.Permissions.Web/AbpPermissionsWebAutoMapperProfile.cs @@ -8,7 +8,9 @@ namespace Volo.Abp.Permissions.Web public AbpPermissionsWebAutoMapperProfile() { CreateMap(); + CreateMap(); + CreateMap(); } } diff --git a/src/Volo.Abp.Permissions.Web/Pages/AbpPermissions/PermissionManagementModal.cshtml b/src/Volo.Abp.Permissions.Web/Pages/AbpPermissions/PermissionManagementModal.cshtml index 74b8eaa533..2849cc9eb7 100644 --- a/src/Volo.Abp.Permissions.Web/Pages/AbpPermissions/PermissionManagementModal.cshtml +++ b/src/Volo.Abp.Permissions.Web/Pages/AbpPermissions/PermissionManagementModal.cshtml @@ -1,5 +1,6 @@ @page @using Volo.Abp.Permissions.Web.Pages.AbpPermissions +@using Volo.Abp.Session @model PermissionManagementModal @{ Layout = null; @@ -21,8 +22,7 @@ @@ -30,14 +30,13 @@
@for (var i = 0; i < Model.Groups.Count; i++) { - var normalizedGroupName = Model.Groups[i].Name.Replace(".", "_"); -
+
@for (var j = 0; j < Model.Groups[i].Permissions.Count; j++) {
diff --git a/src/Volo.Abp.Permissions.Web/Pages/AbpPermissions/PermissionManagementModal.cshtml.cs b/src/Volo.Abp.Permissions.Web/Pages/AbpPermissions/PermissionManagementModal.cshtml.cs index a54ef53100..0a31a02cfe 100644 --- a/src/Volo.Abp.Permissions.Web/Pages/AbpPermissions/PermissionManagementModal.cshtml.cs +++ b/src/Volo.Abp.Permissions.Web/Pages/AbpPermissions/PermissionManagementModal.cshtml.cs @@ -67,6 +67,11 @@ namespace Volo.Abp.Permissions.Web.Pages.AbpPermissions public string DisplayName { get; set; } public List Permissions { get; set; } + + public string GetNormalizedGroupName() + { + return Name.Replace(".", "_"); + } } public class PermissionGrantInfoViewModel @@ -82,6 +87,28 @@ namespace Volo.Abp.Permissions.Web.Pages.AbpPermissions public bool IsGranted { get; set; } public List Providers { get; set; } + + public bool IsDisabled(string currentProviderName) + { + return IsGranted && Providers.All(p => p.ProviderName != currentProviderName); + } + + public string GetShownName(string currentProviderName) + { + if (!IsDisabled(currentProviderName)) + { + return DisplayName; + } + + return string.Format( + "{0} ({1})", + DisplayName, + Providers + .Where(p => p.ProviderName != currentProviderName) + .Select(p => p.ProviderName) + .JoinAsString(", ") + ); + } } public class ProviderInfoViewModel