From df206383c4d1c8220b0866cad232680051791372 Mon Sep 17 00:00:00 2001 From: wangjun Date: Sat, 15 Jul 2023 16:34:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E5=A4=9A=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AbpProCapPermissionDefinitionProvider.cs | 2 +- .../GlobalUsings.cs | 1 + ...cManagementPermissionDefinitionProvider.cs | 19 +- .../BasicManagementDomainSharedModule.cs | 6 +- .../GlobalUsings.cs | 1 + ...yManagementPermissionDefinitionProvider.cs | 8 +- .../GlobalUsings.cs | 1 + ...eManagementPermissionDefinitionProvider.cs | 16 +- .../LanguageManagementPermissions.cs | 4 +- .../LanguageTexts/LanguageTextAppService.cs | 2 +- .../Languages/LanguageAppService.cs | 2 +- .../vben28/src/views/admin/language/Index.vue | 3 + .../src/views/admin/languageText/Index.vue | 2 + .../vben28/src/views/admin/roles/AbpRole.vue | 197 +++++++++--------- .../vben28/src/views/admin/language/Index.vue | 3 + .../src/views/admin/languageText/Index.vue | 2 + vben28/src/views/admin/language/Index.vue | 3 + vben28/src/views/admin/languageText/Index.vue | 2 + 18 files changed, 146 insertions(+), 128 deletions(-) diff --git a/aspnet-core/frameworks/src/Lion.AbpPro.CAP/Lion/AbpPro/CAP/AbpProCapPermissionDefinitionProvider.cs b/aspnet-core/frameworks/src/Lion.AbpPro.CAP/Lion/AbpPro/CAP/AbpProCapPermissionDefinitionProvider.cs index 68c4af750..7dae9df14 100644 --- a/aspnet-core/frameworks/src/Lion.AbpPro.CAP/Lion/AbpPro/CAP/AbpProCapPermissionDefinitionProvider.cs +++ b/aspnet-core/frameworks/src/Lion.AbpPro.CAP/Lion/AbpPro/CAP/AbpProCapPermissionDefinitionProvider.cs @@ -6,7 +6,7 @@ public override void Define(IPermissionDefinitionContext context) { var abpIdentityGroup = context.GetGroup(AbpProCapPermissions.CapManagement.Default); - abpIdentityGroup.AddPermission(AbpProCapPermissions.CapManagement.Cap, L("Permission:Cap")); + abpIdentityGroup.AddPermission(AbpProCapPermissions.CapManagement.Cap, L("Permission:Cap"), multiTenancySide: MultiTenancySides.Both); } private static LocalizableString L(string name) diff --git a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application.Contracts/GlobalUsings.cs b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application.Contracts/GlobalUsings.cs index 908a8b833..d2493c376 100644 --- a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application.Contracts/GlobalUsings.cs +++ b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application.Contracts/GlobalUsings.cs @@ -11,5 +11,6 @@ global using Volo.Abp.Application.Services; global using Volo.Abp.AspNetCore.Mvc.MultiTenancy; global using Volo.Abp.Data; +global using Volo.Abp.MultiTenancy; global using Volo.Abp.PermissionManagement; global using Volo.Abp.TenantManagement; \ No newline at end of file diff --git a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application.Contracts/Permissions/BasicManagementPermissionDefinitionProvider.cs b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application.Contracts/Permissions/BasicManagementPermissionDefinitionProvider.cs index f53b241c7..7c472e62f 100644 --- a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application.Contracts/Permissions/BasicManagementPermissionDefinitionProvider.cs +++ b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application.Contracts/Permissions/BasicManagementPermissionDefinitionProvider.cs @@ -11,33 +11,32 @@ public override void Define(IPermissionDefinitionContext context) { var abpIdentityGroup = context.GetGroup(IdentityPermissions.GroupName); var userManagement = abpIdentityGroup.GetPermissionOrNull(IdentityPermissions.Users.Default); - userManagement.AddChild(BasicManagementPermissions.SystemManagement.UserEnable, L("Permission:Enable")); - userManagement.AddChild(BasicManagementPermissions.SystemManagement.UserExport, L("Permission:Export")); + userManagement.AddChild(BasicManagementPermissions.SystemManagement.UserEnable, L("Permission:Enable"), multiTenancySide: MultiTenancySides.Both); + userManagement.AddChild(BasicManagementPermissions.SystemManagement.UserExport, L("Permission:Export"), multiTenancySide: MultiTenancySides.Both); var auditManagement = - abpIdentityGroup.AddPermission(BasicManagementPermissions.SystemManagement.AuditLog, L("Permission:AuditLogManagement")); - var settingManagement = abpIdentityGroup.AddPermission(BasicManagementPermissions.SystemManagement.Setting, L("Permission:SettingManagement")); - var organizationUnitManagement = abpIdentityGroup.AddPermission(BasicManagementPermissions.SystemManagement.OrganizationUnit, L("Permission:OrganizationUnitManagement")); + abpIdentityGroup.AddPermission(BasicManagementPermissions.SystemManagement.AuditLog, L("Permission:AuditLogManagement"), multiTenancySide: MultiTenancySides.Both); + var settingManagement = abpIdentityGroup.AddPermission(BasicManagementPermissions.SystemManagement.Setting, L("Permission:SettingManagement"), multiTenancySide: MultiTenancySides.Both); + var organizationUnitManagement = abpIdentityGroup.AddPermission(BasicManagementPermissions.SystemManagement.OrganizationUnit, L("Permission:OrganizationUnitManagement"), multiTenancySide: MultiTenancySides.Both); organizationUnitManagement.AddChild ( BasicManagementPermissions.SystemManagement.OrganizationUnitManagement.Create, - L("Permission:Create") + L("Permission:Create"), multiTenancySide: MultiTenancySides.Both ); organizationUnitManagement.AddChild ( BasicManagementPermissions.SystemManagement.OrganizationUnitManagement.Update, - L("Permission:Update") + L("Permission:Update"), multiTenancySide: MultiTenancySides.Both ); organizationUnitManagement.AddChild ( BasicManagementPermissions.SystemManagement.OrganizationUnitManagement.Delete, - L("Permission:Delete") + L("Permission:Delete"), multiTenancySide: MultiTenancySides.Both ); - } private static LocalizableString L(string name) { return LocalizableString.Create(name); } -} +} \ No newline at end of file diff --git a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Domain.Shared/BasicManagementDomainSharedModule.cs b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Domain.Shared/BasicManagementDomainSharedModule.cs index ac3d8b3aa..251843003 100644 --- a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Domain.Shared/BasicManagementDomainSharedModule.cs +++ b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Domain.Shared/BasicManagementDomainSharedModule.cs @@ -25,11 +25,7 @@ public override void ConfigureServices(ServiceConfigurationContext context) { options.Resources .Add(BasicManagementConsts.DefaultCultureName) - .AddVirtualJson("/Localization/BasicManagement") - .AddBaseTypes(typeof(IdentityResource)) - .AddBaseTypes(typeof(AbpValidationResource)) - .AddBaseTypes(typeof(AbpLocalizationResource)) - .AddBaseTypes(typeof(AbpSettingManagementResource)); + .AddVirtualJson("/Localization/BasicManagement"); options.DefaultResourceType = typeof(BasicManagementResource); }); diff --git a/aspnet-core/modules/DataDictionaryManagement/src/Lion.AbpPro.DataDictionaryManagement.Application.Contracts/GlobalUsings.cs b/aspnet-core/modules/DataDictionaryManagement/src/Lion.AbpPro.DataDictionaryManagement.Application.Contracts/GlobalUsings.cs index ef7477b5d..f68705f63 100644 --- a/aspnet-core/modules/DataDictionaryManagement/src/Lion.AbpPro.DataDictionaryManagement.Application.Contracts/GlobalUsings.cs +++ b/aspnet-core/modules/DataDictionaryManagement/src/Lion.AbpPro.DataDictionaryManagement.Application.Contracts/GlobalUsings.cs @@ -20,4 +20,5 @@ global using Volo.Abp.Authorization.Permissions; global using Volo.Abp.Localization; global using Volo.Abp.Modularity; +global using Volo.Abp.MultiTenancy; global using Volo.Abp.Reflection; \ No newline at end of file diff --git a/aspnet-core/modules/DataDictionaryManagement/src/Lion.AbpPro.DataDictionaryManagement.Application.Contracts/Permissions/DataDictionaryManagementPermissionDefinitionProvider.cs b/aspnet-core/modules/DataDictionaryManagement/src/Lion.AbpPro.DataDictionaryManagement.Application.Contracts/Permissions/DataDictionaryManagementPermissionDefinitionProvider.cs index ca43f16d8..ab2766e03 100644 --- a/aspnet-core/modules/DataDictionaryManagement/src/Lion.AbpPro.DataDictionaryManagement.Application.Contracts/Permissions/DataDictionaryManagementPermissionDefinitionProvider.cs +++ b/aspnet-core/modules/DataDictionaryManagement/src/Lion.AbpPro.DataDictionaryManagement.Application.Contracts/Permissions/DataDictionaryManagementPermissionDefinitionProvider.cs @@ -7,10 +7,10 @@ public override void Define(IPermissionDefinitionContext context) var abpIdentityGroup = context.GetGroup("AbpIdentity"); var dataDictionaryManagement = abpIdentityGroup.AddPermission(DataDictionaryManagementPermissions.DataDictionaryManagement.Default, - L("Permission:DataDictionaryManagement")); - dataDictionaryManagement.AddChild(DataDictionaryManagementPermissions.DataDictionaryManagement.Create, L("Permission:Create")); - dataDictionaryManagement.AddChild(DataDictionaryManagementPermissions.DataDictionaryManagement.Update, L("Permission:Update")); - dataDictionaryManagement.AddChild(DataDictionaryManagementPermissions.DataDictionaryManagement.Delete, L("Permission:Delete")); + L("Permission:DataDictionaryManagement"), multiTenancySide: MultiTenancySides.Both); + dataDictionaryManagement.AddChild(DataDictionaryManagementPermissions.DataDictionaryManagement.Create, L("Permission:Create"), multiTenancySide: MultiTenancySides.Both); + dataDictionaryManagement.AddChild(DataDictionaryManagementPermissions.DataDictionaryManagement.Update, L("Permission:Update"), multiTenancySide: MultiTenancySides.Both); + dataDictionaryManagement.AddChild(DataDictionaryManagementPermissions.DataDictionaryManagement.Delete, L("Permission:Delete"), multiTenancySide: MultiTenancySides.Both); } private static LocalizableString L(string name) diff --git a/aspnet-core/modules/LanguageManagement/src/Lion.AbpPro.LanguageManagement.Application.Contracts/GlobalUsings.cs b/aspnet-core/modules/LanguageManagement/src/Lion.AbpPro.LanguageManagement.Application.Contracts/GlobalUsings.cs index 61f55d33e..b3dbd61ff 100644 --- a/aspnet-core/modules/LanguageManagement/src/Lion.AbpPro.LanguageManagement.Application.Contracts/GlobalUsings.cs +++ b/aspnet-core/modules/LanguageManagement/src/Lion.AbpPro.LanguageManagement.Application.Contracts/GlobalUsings.cs @@ -19,4 +19,5 @@ global using Volo.Abp.Authorization.Permissions; global using Volo.Abp.Localization; global using Volo.Abp.Modularity; +global using Volo.Abp.MultiTenancy; global using Volo.Abp.Reflection; \ No newline at end of file diff --git a/aspnet-core/modules/LanguageManagement/src/Lion.AbpPro.LanguageManagement.Application.Contracts/Permissions/LanguageManagementPermissionDefinitionProvider.cs b/aspnet-core/modules/LanguageManagement/src/Lion.AbpPro.LanguageManagement.Application.Contracts/Permissions/LanguageManagementPermissionDefinitionProvider.cs index c849b1804..3d1ca55aa 100644 --- a/aspnet-core/modules/LanguageManagement/src/Lion.AbpPro.LanguageManagement.Application.Contracts/Permissions/LanguageManagementPermissionDefinitionProvider.cs +++ b/aspnet-core/modules/LanguageManagement/src/Lion.AbpPro.LanguageManagement.Application.Contracts/Permissions/LanguageManagementPermissionDefinitionProvider.cs @@ -8,16 +8,16 @@ public override void Define(IPermissionDefinitionContext context) // var languageManagement = context.AddGroup(LanguageManagementPermissions.GroupName, L("Permission:LanguageManagement")); - var languages = abpIdentityGroup.AddPermission(LanguageManagementPermissions.Languages.Default, L("Permission:Languages")); - languages.AddChild(LanguageManagementPermissions.Languages.Create, L("Permission:Create")); - languages.AddChild(LanguageManagementPermissions.Languages.Edit, L("Permission:Edit")); - languages.AddChild(LanguageManagementPermissions.Languages.Delete, L("Permission:Delete")); - languages.AddChild(LanguageManagementPermissions.Languages.ChangeDefault, L("Permission:LanguagesChangeDefault")); + var languages = abpIdentityGroup.AddPermission(LanguageManagementPermissions.Languages.Default, L("Permission:Languages"), multiTenancySide: MultiTenancySides.Both); + languages.AddChild(LanguageManagementPermissions.Languages.Create, L("Permission:Create"), multiTenancySide: MultiTenancySides.Both); + languages.AddChild(LanguageManagementPermissions.Languages.Update, L("Permission:Update"), multiTenancySide: MultiTenancySides.Both); + languages.AddChild(LanguageManagementPermissions.Languages.Delete, L("Permission:Delete"), multiTenancySide: MultiTenancySides.Both); + languages.AddChild(LanguageManagementPermissions.Languages.ChangeDefault, L("Permission:LanguagesChangeDefault"), multiTenancySide: MultiTenancySides.Both); - var languageTexts = abpIdentityGroup.AddPermission(LanguageManagementPermissions.LanguageTexts.Default, L("Permission:LanguageTexts")); - languageTexts.AddChild(LanguageManagementPermissions.LanguageTexts.Edit, L("Permission:Edit")); - languageTexts.AddChild(LanguageManagementPermissions.LanguageTexts.Create, L("Permission:Create")); + var languageTexts = abpIdentityGroup.AddPermission(LanguageManagementPermissions.LanguageTexts.Default, L("Permission:LanguageTexts"), multiTenancySide: MultiTenancySides.Both); + languageTexts.AddChild(LanguageManagementPermissions.LanguageTexts.Update, L("Permission:Update"), multiTenancySide: MultiTenancySides.Both); + languageTexts.AddChild(LanguageManagementPermissions.LanguageTexts.Create, L("Permission:Create"), multiTenancySide: MultiTenancySides.Both); } private static LocalizableString L(string name) diff --git a/aspnet-core/modules/LanguageManagement/src/Lion.AbpPro.LanguageManagement.Application.Contracts/Permissions/LanguageManagementPermissions.cs b/aspnet-core/modules/LanguageManagement/src/Lion.AbpPro.LanguageManagement.Application.Contracts/Permissions/LanguageManagementPermissions.cs index 3a927162c..8e110619a 100644 --- a/aspnet-core/modules/LanguageManagement/src/Lion.AbpPro.LanguageManagement.Application.Contracts/Permissions/LanguageManagementPermissions.cs +++ b/aspnet-core/modules/LanguageManagement/src/Lion.AbpPro.LanguageManagement.Application.Contracts/Permissions/LanguageManagementPermissions.cs @@ -17,14 +17,14 @@ public class LanguageTexts public const string Create = "AbpIdentity.LanguageTexts.Create"; - public const string Edit = "AbpIdentity.LanguageTexts.Edit"; + public const string Update = "AbpIdentity.LanguageTexts.Update"; } public class Languages { public const string Default = "AbpIdentity.Languages"; - public const string Edit = "AbpIdentity.Languages.Edit"; + public const string Update = "AbpIdentity.Languages.Update"; public const string Create = "AbpIdentity.Languages.Create"; diff --git a/aspnet-core/modules/LanguageManagement/src/Lion.AbpPro.LanguageManagement.Application/LanguageTexts/LanguageTextAppService.cs b/aspnet-core/modules/LanguageManagement/src/Lion.AbpPro.LanguageManagement.Application/LanguageTexts/LanguageTextAppService.cs index 10a3993eb..16152b8f3 100644 --- a/aspnet-core/modules/LanguageManagement/src/Lion.AbpPro.LanguageManagement.Application/LanguageTexts/LanguageTextAppService.cs +++ b/aspnet-core/modules/LanguageManagement/src/Lion.AbpPro.LanguageManagement.Application/LanguageTexts/LanguageTextAppService.cs @@ -115,7 +115,7 @@ await _languageTextManager.CreateAsync( /// /// 编辑语言文本 /// - [Authorize(LanguageManagementPermissions.LanguageTexts.Edit)] + [Authorize(LanguageManagementPermissions.LanguageTexts.Update)] public async Task UpdateAsync(UpdateLanguageTextInput input) { var localizedString = await GetLocalizedStringAsync(input.ResourceName, input.CultureName, input.Name); diff --git a/aspnet-core/modules/LanguageManagement/src/Lion.AbpPro.LanguageManagement.Application/Languages/LanguageAppService.cs b/aspnet-core/modules/LanguageManagement/src/Lion.AbpPro.LanguageManagement.Application/Languages/LanguageAppService.cs index e8160daf5..9e12ef1ac 100644 --- a/aspnet-core/modules/LanguageManagement/src/Lion.AbpPro.LanguageManagement.Application/Languages/LanguageAppService.cs +++ b/aspnet-core/modules/LanguageManagement/src/Lion.AbpPro.LanguageManagement.Application/Languages/LanguageAppService.cs @@ -59,7 +59,7 @@ public Task CreateAsync(CreateLanguageInput input) /// /// 编辑语言 /// - [Authorize(LanguageManagementPermissions.Languages.Edit)] + [Authorize(LanguageManagementPermissions.Languages.Update)] public Task UpdateAsync(UpdateLanguageInput input) { return _languageManager.UpdateAsync( diff --git a/templates/abp-vnext-pro-nuget-all/vben28/src/views/admin/language/Index.vue b/templates/abp-vnext-pro-nuget-all/vben28/src/views/admin/language/Index.vue index f9b08ed93..37f8c7c8e 100644 --- a/templates/abp-vnext-pro-nuget-all/vben28/src/views/admin/language/Index.vue +++ b/templates/abp-vnext-pro-nuget-all/vben28/src/views/admin/language/Index.vue @@ -6,6 +6,7 @@ preIcon="ant-design:plus-circle-outlined" type="primary" @click="openCreateLanguageModal" + v-auth="'AbpIdentity.Languages.Create'" > {{ t('common.createText') }} @@ -28,12 +29,14 @@ { icon: 'clarity:note-edit-line', label: t('common.editText'), + auth: 'AbpIdentity.Languages.Update', onClick: handleEdit.bind(null, record), }, { icon: 'ant-design:delete-outlined', color: 'error', label: t('common.delText'), + auth: 'AbpIdentity.Languages.Update', popConfirm: { title: t('common.askDelete'), placement: 'left', diff --git a/templates/abp-vnext-pro-nuget-all/vben28/src/views/admin/languageText/Index.vue b/templates/abp-vnext-pro-nuget-all/vben28/src/views/admin/languageText/Index.vue index d509dba0b..7a0ccecad 100644 --- a/templates/abp-vnext-pro-nuget-all/vben28/src/views/admin/languageText/Index.vue +++ b/templates/abp-vnext-pro-nuget-all/vben28/src/views/admin/languageText/Index.vue @@ -6,6 +6,7 @@ preIcon="ant-design:plus-circle-outlined" type="primary" @click="openCreateLanguageTextModal" + v-auth="'AbpIdentity.LanguageTexts.Create'" > {{ t('common.createText') }} @@ -17,6 +18,7 @@ { icon: 'clarity:note-edit-line', label: t('common.editText'), + auth: 'AbpIdentity.LanguageTexts.Update', onClick: handleEdit.bind(null, record), }, ]" diff --git a/templates/abp-vnext-pro-nuget-all/vben28/src/views/admin/roles/AbpRole.vue b/templates/abp-vnext-pro-nuget-all/vben28/src/views/admin/roles/AbpRole.vue index 963b9f735..167e06dd3 100644 --- a/templates/abp-vnext-pro-nuget-all/vben28/src/views/admin/roles/AbpRole.vue +++ b/templates/abp-vnext-pro-nuget-all/vben28/src/views/admin/roles/AbpRole.vue @@ -1,13 +1,13 @@