From 5ca3e9122bf6b0f9ec2a43f2c29e3796d1b492d0 Mon Sep 17 00:00:00 2001 From: gdlcf88 Date: Tue, 31 Oct 2023 22:41:39 +0800 Subject: [PATCH] Redesign management permissions as read-write separation --- common.props | 2 +- .../PrepaymentPermissionDefinitionProvider.cs | 6 +++-- .../Permissions/PrepaymentPermissions.cs | 10 ++++++-- .../Prepayment/Accounts/AccountAppService.cs | 8 +++---- .../Prepayment/Localization/cs.json | 7 ++++++ .../Prepayment/Localization/en.json | 7 ++++++ .../Prepayment/Localization/pl-PL.json | 7 ++++++ .../Prepayment/Localization/pt-BR.json | 7 ++++++ .../Prepayment/Localization/sl.json | 7 ++++++ .../Prepayment/Localization/tr.json | 7 ++++++ .../Prepayment/Localization/vi.json | 7 ++++++ .../Prepayment/Localization/zh-Hans.json | 7 ++++++ .../Prepayment/Localization/zh-Hant.json | 7 ++++++ .../Menus/PrepaymentMenuContributor.cs | 2 +- .../WeChatPayPermissionDefinitionProvider.cs | 2 +- .../WeChatPay/Localization/WeChatPay/cs.json | 3 +++ .../WeChatPay/Localization/WeChatPay/en.json | 3 +++ .../WeChatPay/Localization/WeChatPay/pl.json | 3 +++ .../Localization/WeChatPay/pt-BR.json | 3 +++ .../WeChatPay/Localization/WeChatPay/sl.json | 3 +++ .../WeChatPay/Localization/WeChatPay/tr.json | 3 +++ .../WeChatPay/Localization/WeChatPay/vi.json | 3 +++ .../Localization/WeChatPay/zh-Hans.json | 3 +++ .../Localization/WeChatPay/zh-Hant.json | 3 +++ ...mentServicePermissionDefinitionProvider.cs | 11 +++------ .../PaymentServicePermissions.cs | 24 ++++++++----------- .../Payments/PaymentAppService.cs | 8 +++---- .../Localization/PaymentService/cs.json | 6 +++++ .../Localization/PaymentService/en.json | 6 +++++ .../Localization/PaymentService/pl.json | 6 +++++ .../Localization/PaymentService/pt-BR.json | 6 +++++ .../Localization/PaymentService/sl.json | 6 +++++ .../Localization/PaymentService/tr.json | 6 +++++ .../Localization/PaymentService/vi.json | 6 +++++ .../Localization/PaymentService/zh-Hans.json | 6 +++++ .../Localization/PaymentService/zh-Hant.json | 6 +++++ .../Menus/PaymentServiceMenuContributor.cs | 2 +- 37 files changed, 181 insertions(+), 38 deletions(-) diff --git a/common.props b/common.props index 78099d83..bdd3ef7c 100644 --- a/common.props +++ b/common.props @@ -1,7 +1,7 @@ latest - 2.8.0 + 2.9.0 $(NoWarn);CS1591 true EasyAbp Team diff --git a/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Application.Contracts/EasyAbp/PaymentService/Prepayment/Permissions/PrepaymentPermissionDefinitionProvider.cs b/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Application.Contracts/EasyAbp/PaymentService/Prepayment/Permissions/PrepaymentPermissionDefinitionProvider.cs index cc4f7555..dbf65818 100644 --- a/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Application.Contracts/EasyAbp/PaymentService/Prepayment/Permissions/PrepaymentPermissionDefinitionProvider.cs +++ b/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Application.Contracts/EasyAbp/PaymentService/Prepayment/Permissions/PrepaymentPermissionDefinitionProvider.cs @@ -8,10 +8,12 @@ public class PrepaymentPermissionDefinitionProvider : PermissionDefinitionProvid { public override void Define(IPermissionDefinitionContext context) { - var myGroup = context.AddGroup(PrepaymentPermissions.GroupName, L("Permission:Prepayment")); + var myGroup = context.AddGroup(PrepaymentPermissions.GroupName, L("Permission:PaymentServicePrepayment")); var accountPermission = myGroup.AddPermission(PrepaymentPermissions.Account.Default, L("Permission:Account")); - accountPermission.AddChild(PrepaymentPermissions.Account.Manage, L("Permission:Manage")); + accountPermission.AddChild(PrepaymentPermissions.Account.Manage.ManageDefault, L("Permission:Manage")); + accountPermission.AddChild(PrepaymentPermissions.Account.Manage.ChangeBalance, L("Permission:ChangeBalance")); + accountPermission.AddChild(PrepaymentPermissions.Account.Manage.ChangeLockedBalance, L("Permission:ChangeLockedBalance")); accountPermission.AddChild(PrepaymentPermissions.Account.TopUp, L("Permission:TopUp")); accountPermission.AddChild(PrepaymentPermissions.Account.Withdraw, L("Permission:Withdraw")); diff --git a/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Application.Contracts/EasyAbp/PaymentService/Prepayment/Permissions/PrepaymentPermissions.cs b/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Application.Contracts/EasyAbp/PaymentService/Prepayment/Permissions/PrepaymentPermissions.cs index 096c77f2..19b3a5af 100644 --- a/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Application.Contracts/EasyAbp/PaymentService/Prepayment/Permissions/PrepaymentPermissions.cs +++ b/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Application.Contracts/EasyAbp/PaymentService/Prepayment/Permissions/PrepaymentPermissions.cs @@ -14,9 +14,15 @@ public static string[] GetAll() public class Account { public const string Default = GroupName + ".Account"; - public const string Manage = Default + ".Manage"; public const string TopUp = Default + ".TopUp"; public const string Withdraw = Default + ".Withdraw"; + + public class Manage + { + public const string ManageDefault = Default + ".Manage"; + public const string ChangeBalance = ManageDefault + ".ChangeBalance"; + public const string ChangeLockedBalance = ManageDefault + ".ChangeLockedBalance"; + } } public class Transaction @@ -38,4 +44,4 @@ public class WithdrawalRequest public const string Review = Default + ".Review"; } } -} +} \ No newline at end of file diff --git a/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Application/EasyAbp/PaymentService/Prepayment/Accounts/AccountAppService.cs b/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Application/EasyAbp/PaymentService/Prepayment/Accounts/AccountAppService.cs index d5578c67..a0359299 100644 --- a/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Application/EasyAbp/PaymentService/Prepayment/Accounts/AccountAppService.cs +++ b/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Application/EasyAbp/PaymentService/Prepayment/Accounts/AccountAppService.cs @@ -51,7 +51,7 @@ public override async Task GetAsync(Guid id) if (dto.UserId != CurrentUser.GetId()) { - await AuthorizationService.CheckAsync(PrepaymentPermissions.Account.Manage); + await AuthorizationService.CheckAsync(PrepaymentPermissions.Account.Manage.ManageDefault); } return dto; @@ -68,7 +68,7 @@ public override async Task> GetListAsync(GetAccountLi { if (input.UserId != CurrentUser.GetId()) { - await AuthorizationService.CheckAsync(PrepaymentPermissions.Account.Manage); + await AuthorizationService.CheckAsync(PrepaymentPermissions.Account.Manage.ManageDefault); } var result = await base.GetListAsync(input); @@ -97,7 +97,7 @@ await _repository.InsertAsync(new Account(GuidGenerator.Create(), CurrentTenant. return result; } - [Authorize(PrepaymentPermissions.Account.Manage)] + [Authorize(PrepaymentPermissions.Account.Manage.ChangeBalance)] public virtual async Task ChangeBalanceAsync(Guid id, ChangeBalanceInput input) { var account = await _repository.GetAsync(id); @@ -120,7 +120,7 @@ public virtual async Task ChangeBalanceAsync(Guid id, ChangeBalanceI return await MapToGetOutputDtoAsync(account); } - [Authorize(PrepaymentPermissions.Account.Manage)] + [Authorize(PrepaymentPermissions.Account.Manage.ChangeLockedBalance)] public virtual async Task ChangeLockedBalanceAsync(Guid id, ChangeLockedBalanceInput input) { var account = await _repository.GetAsync(id); diff --git a/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/cs.json b/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/cs.json index d4446671..d01e22da 100644 --- a/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/cs.json +++ b/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/cs.json @@ -3,10 +3,17 @@ "texts": { "Menu:PaymentService": "Payment service", "Menu:PrepaymentManagement": "Prepayment", + "Permission:PaymentServicePrepayment": "Payment service - Prepayment", "Permission:Account": "Account", "Permission:Create": "Create", "Permission:Update": "Update", "Permission:Delete": "Delete", + "Permission:Manage": "Manage", + "Permission:ChangeBalance": "Change balance", + "Permission:ChangeLockedBalance": "Changed locked balance", + "Permission:TopUp": "TopUp", + "Permission:Withdraw": "Withdraw", + "Permission:Review": "Review", "Menu:Account": "Account", "Account": "Account", "AccountAccountGroupName": "Account group name", diff --git a/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/en.json b/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/en.json index f4a122e6..384dbd44 100644 --- a/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/en.json +++ b/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/en.json @@ -3,10 +3,17 @@ "texts": { "Menu:PaymentService": "Payment service", "Menu:PrepaymentManagement": "Prepayment", + "Permission:PaymentServicePrepayment": "Payment service - Prepayment", "Permission:Account": "Account", "Permission:Create": "Create", "Permission:Update": "Update", "Permission:Delete": "Delete", + "Permission:Manage": "Manage", + "Permission:ChangeBalance": "Change balance", + "Permission:ChangeLockedBalance": "Changed locked balance", + "Permission:TopUp": "TopUp", + "Permission:Withdraw": "Withdraw", + "Permission:Review": "Review", "Menu:Account": "Account", "Account": "Account", "AccountAccountGroupName": "Account group name", diff --git a/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/pl-PL.json b/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/pl-PL.json index 78ecd126..7d19e86b 100644 --- a/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/pl-PL.json +++ b/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/pl-PL.json @@ -3,10 +3,17 @@ "texts": { "Menu:PaymentService": "Payment service", "Menu:PrepaymentManagement": "Prepayment", + "Permission:PaymentServicePrepayment": "Payment service - Prepayment", "Permission:Account": "Account", "Permission:Create": "Create", "Permission:Update": "Update", "Permission:Delete": "Delete", + "Permission:Manage": "Manage", + "Permission:ChangeBalance": "Change balance", + "Permission:ChangeLockedBalance": "Changed locked balance", + "Permission:TopUp": "TopUp", + "Permission:Withdraw": "Withdraw", + "Permission:Review": "Review", "Menu:Account": "Account", "Account": "Account", "AccountAccountGroupName": "Account group name", diff --git a/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/pt-BR.json b/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/pt-BR.json index 0ab20b68..f5d03847 100644 --- a/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/pt-BR.json +++ b/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/pt-BR.json @@ -3,10 +3,17 @@ "texts": { "Menu:PaymentService": "Payment service", "Menu:PrepaymentManagement": "Prepayment", + "Permission:PaymentServicePrepayment": "Payment service - Prepayment", "Permission:Account": "Account", "Permission:Create": "Create", "Permission:Update": "Update", "Permission:Delete": "Delete", + "Permission:Manage": "Manage", + "Permission:ChangeBalance": "Change balance", + "Permission:ChangeLockedBalance": "Changed locked balance", + "Permission:TopUp": "TopUp", + "Permission:Withdraw": "Withdraw", + "Permission:Review": "Review", "Menu:Account": "Account", "Account": "Account", "AccountAccountGroupName": "Account group name", diff --git a/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/sl.json b/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/sl.json index 950dc587..ce82491e 100644 --- a/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/sl.json +++ b/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/sl.json @@ -3,10 +3,17 @@ "texts": { "Menu:PaymentService": "Payment service", "Menu:PrepaymentManagement": "Prepayment", + "Permission:PaymentServicePrepayment": "Payment service - Prepayment", "Permission:Account": "Account", "Permission:Create": "Create", "Permission:Update": "Update", "Permission:Delete": "Delete", + "Permission:Manage": "Manage", + "Permission:ChangeBalance": "Change balance", + "Permission:ChangeLockedBalance": "Changed locked balance", + "Permission:TopUp": "TopUp", + "Permission:Withdraw": "Withdraw", + "Permission:Review": "Review", "Menu:Account": "Account", "Account": "Account", "AccountAccountGroupName": "Account group name", diff --git a/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/tr.json b/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/tr.json index 69928fcb..c26671e4 100644 --- a/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/tr.json +++ b/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/tr.json @@ -3,10 +3,17 @@ "texts": { "Menu:PaymentService": "Payment service", "Menu:PrepaymentManagement": "Prepayment", + "Permission:PaymentServicePrepayment": "Payment service - Prepayment", "Permission:Account": "Account", "Permission:Create": "Create", "Permission:Update": "Update", "Permission:Delete": "Delete", + "Permission:Manage": "Manage", + "Permission:ChangeBalance": "Change balance", + "Permission:ChangeLockedBalance": "Changed locked balance", + "Permission:TopUp": "TopUp", + "Permission:Withdraw": "Withdraw", + "Permission:Review": "Review", "Menu:Account": "Account", "Account": "Account", "AccountAccountGroupName": "Account group name", diff --git a/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/vi.json b/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/vi.json index 94f414b4..9e33b519 100644 --- a/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/vi.json +++ b/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/vi.json @@ -3,10 +3,17 @@ "texts": { "Menu:PaymentService": "Payment service", "Menu:PrepaymentManagement": "Prepayment", + "Permission:PaymentServicePrepayment": "Payment service - Prepayment", "Permission:Account": "Account", "Permission:Create": "Create", "Permission:Update": "Update", "Permission:Delete": "Delete", + "Permission:Manage": "Manage", + "Permission:ChangeBalance": "Change balance", + "Permission:ChangeLockedBalance": "Changed locked balance", + "Permission:TopUp": "TopUp", + "Permission:Withdraw": "Withdraw", + "Permission:Review": "Review", "Menu:Account": "Account", "Account": "Account", "AccountAccountGroupName": "Account group name", diff --git a/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/zh-Hans.json b/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/zh-Hans.json index 84890c98..c8e452bc 100644 --- a/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/zh-Hans.json +++ b/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/zh-Hans.json @@ -3,10 +3,17 @@ "texts": { "Menu:PaymentService": "支付服务", "Menu:PrepaymentManagement": "储值卡", + "Permission:PaymentServicePrepayment": "支付服务 - 储值卡", "Permission:Account": "账户", "Permission:Create": "新建", "Permission:Update": "编辑", "Permission:Delete": "删除", + "Permission:Manage": "管理", + "Permission:ChangeBalance": "调整余额", + "Permission:ChangeLockedBalance": "调整锁定余额", + "Permission:TopUp": "充值", + "Permission:Withdraw": "提现", + "Permission:Review": "审核", "Menu:Account": "账户", "Account": "账户", "AccountAccountGroupName": "账户组", diff --git a/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/zh-Hant.json b/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/zh-Hant.json index 92b4b6bd..8c01f230 100644 --- a/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/zh-Hant.json +++ b/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Domain.Shared/EasyAbp/PaymentService/Prepayment/Localization/zh-Hant.json @@ -3,10 +3,17 @@ "texts": { "Menu:PaymentService": "支付服務", "Menu:PrepaymentManagement": "儲值卡", + "Permission:PaymentServicePrepayment": "支付服務 - 儲值卡", "Permission:Account": "賬戶", "Permission:Create": "新建", "Permission:Update": "編輯", "Permission:Delete": "刪除", + "Permission:Manage": "管理", + "Permission:ChangeBalance": "調整餘額", + "Permission:ChangeLockedBalance": "調整鎖定餘額", + "Permission:TopUp": "充值", + "Permission:Withdraw": "提現", + "Permission:Review": "審核", "Menu:Account": "賬戶", "Account": "賬戶", "AccountAccountGroupName": "賬戶組", diff --git a/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Web/Menus/PrepaymentMenuContributor.cs b/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Web/Menus/PrepaymentMenuContributor.cs index 88299b7d..f28f85e5 100644 --- a/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Web/Menus/PrepaymentMenuContributor.cs +++ b/modules/EasyAbp.PaymentService.Prepayment/src/EasyAbp.PaymentService.Prepayment.Web/Menus/PrepaymentMenuContributor.cs @@ -23,7 +23,7 @@ private async Task ConfigureMainMenu(MenuConfigurationContext context) var prepaymentManagementMenuItem = new ApplicationMenuItem(PrepaymentMenus.Prefix, l["Menu:PrepaymentManagement"]); - if (await context.IsGrantedAsync(PrepaymentPermissions.Account.Manage)) + if (await context.IsGrantedAsync(PrepaymentPermissions.Account.Manage.ManageDefault)) { prepaymentManagementMenuItem.AddItem( new ApplicationMenuItem(PrepaymentMenus.Account, l["Menu:Account"], "/PaymentService/Prepayment/Accounts/Account") diff --git a/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Application.Contracts/EasyAbp/PaymentService/WeChatPay/Authorization/WeChatPayPermissionDefinitionProvider.cs b/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Application.Contracts/EasyAbp/PaymentService/WeChatPay/Authorization/WeChatPayPermissionDefinitionProvider.cs index 0f7a37af..0eeeeac7 100644 --- a/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Application.Contracts/EasyAbp/PaymentService/WeChatPay/Authorization/WeChatPayPermissionDefinitionProvider.cs +++ b/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Application.Contracts/EasyAbp/PaymentService/WeChatPay/Authorization/WeChatPayPermissionDefinitionProvider.cs @@ -8,7 +8,7 @@ public class WeChatPayPermissionDefinitionProvider : PermissionDefinitionProvide { public override void Define(IPermissionDefinitionContext context) { - var moduleGroup = context.AddGroup(WeChatPayPermissions.GroupName, L("Permission:WeChatPay")); + var moduleGroup = context.AddGroup(WeChatPayPermissions.GroupName, L("Permission:PaymentServiceWeChatPay")); var paymentRecord = moduleGroup.AddPermission(WeChatPayPermissions.PaymentRecords.Default, L("Permission:PaymentRecord")); diff --git a/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/cs.json b/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/cs.json index 6834cd7b..d57b48ed 100644 --- a/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/cs.json +++ b/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/cs.json @@ -4,6 +4,9 @@ "Menu:PaymentService": "Payment service", "Menu:WeChatPayManagement": "WeChat Pay", "Menu:RefundRecord": "Refund record", + "Permission:PaymentServiceWeChatPay": "Payment service - WeChat Pay", + "Permission:PaymentRecord": "PaymentRecord", + "Permission:RefundRecord": "RefundRecord", "RefundRecord": "Refund record", "RefundRecordPaymentId": "Payment ID", "RefundRecordReturnCode": "ReturnCode", diff --git a/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/en.json b/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/en.json index 75db5b5a..becee486 100644 --- a/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/en.json +++ b/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/en.json @@ -4,6 +4,9 @@ "Menu:PaymentService": "Payment service", "Menu:WeChatPayManagement": "WeChat Pay", "Menu:RefundRecord": "Refund record", + "Permission:PaymentServiceWeChatPay": "Payment service - WeChat Pay", + "Permission:PaymentRecord": "PaymentRecord", + "Permission:RefundRecord": "RefundRecord", "RefundRecord": "Refund record", "RefundRecordPaymentId": "Payment ID", "RefundRecordReturnCode": "ReturnCode", diff --git a/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/pl.json b/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/pl.json index 8269e103..120fd438 100644 --- a/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/pl.json +++ b/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/pl.json @@ -4,6 +4,9 @@ "Menu:PaymentService": "Payment service", "Menu:WeChatPayManagement": "WeChat Pay", "Menu:RefundRecord": "Refund record", + "Permission:PaymentServiceWeChatPay": "Payment service - WeChat Pay", + "Permission:PaymentRecord": "PaymentRecord", + "Permission:RefundRecord": "RefundRecord", "RefundRecord": "Refund record", "RefundRecordPaymentId": "Payment ID", "RefundRecordReturnCode": "ReturnCode", diff --git a/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/pt-BR.json b/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/pt-BR.json index 5d0448cc..d39bc0f5 100644 --- a/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/pt-BR.json +++ b/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/pt-BR.json @@ -4,6 +4,9 @@ "Menu:PaymentService": "Payment service", "Menu:WeChatPayManagement": "WeChat Pay", "Menu:RefundRecord": "Refund record", + "Permission:PaymentServiceWeChatPay": "Payment service - WeChat Pay", + "Permission:PaymentRecord": "PaymentRecord", + "Permission:RefundRecord": "RefundRecord", "RefundRecord": "Refund record", "RefundRecordPaymentId": "Payment ID", "RefundRecordReturnCode": "ReturnCode", diff --git a/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/sl.json b/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/sl.json index 4711e597..26c48ace 100644 --- a/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/sl.json +++ b/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/sl.json @@ -4,6 +4,9 @@ "Menu:PaymentService": "Payment service", "Menu:WeChatPayManagement": "WeChat Pay", "Menu:RefundRecord": "Refund record", + "Permission:PaymentServiceWeChatPay": "Payment service - WeChat Pay", + "Permission:PaymentRecord": "PaymentRecord", + "Permission:RefundRecord": "RefundRecord", "RefundRecord": "Refund record", "RefundRecordPaymentId": "Payment ID", "RefundRecordReturnCode": "ReturnCode", diff --git a/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/tr.json b/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/tr.json index 204309d3..6f6af8ef 100644 --- a/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/tr.json +++ b/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/tr.json @@ -4,6 +4,9 @@ "Menu:PaymentService": "Payment service", "Menu:WeChatPayManagement": "WeChat Pay", "Menu:RefundRecord": "Refund record", + "Permission:PaymentServiceWeChatPay": "Payment service - WeChat Pay", + "Permission:PaymentRecord": "PaymentRecord", + "Permission:RefundRecord": "RefundRecord", "RefundRecord": "Refund record", "RefundRecordPaymentId": "Payment ID", "RefundRecordReturnCode": "ReturnCode", diff --git a/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/vi.json b/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/vi.json index 4f56d1ab..6b1d1ea8 100644 --- a/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/vi.json +++ b/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/vi.json @@ -4,6 +4,9 @@ "Menu:PaymentService": "Payment service", "Menu:WeChatPayManagement": "WeChat Pay", "Menu:RefundRecord": "Refund record", + "Permission:PaymentServiceWeChatPay": "Payment service - WeChat Pay", + "Permission:PaymentRecord": "PaymentRecord", + "Permission:RefundRecord": "RefundRecord", "RefundRecord": "Refund record", "RefundRecordPaymentId": "Payment ID", "RefundRecordReturnCode": "ReturnCode", diff --git a/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/zh-Hans.json b/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/zh-Hans.json index 025e4f58..d4527ab7 100644 --- a/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/zh-Hans.json +++ b/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/zh-Hans.json @@ -4,6 +4,9 @@ "Menu:PaymentService": "支付服务", "Menu:WeChatPayManagement": "微信支付", "Menu:RefundRecord": "退款记录", + "Permission:PaymentServiceWeChatPay": "支付服务 - 微信支付", + "Permission:PaymentRecord": "支付记录", + "Permission:RefundRecord": "退款记录", "RefundRecord": "退款记录", "RefundRecordPaymentId": "支付 ID", "RefundRecordReturnCode": "ReturnCode", diff --git a/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/zh-Hant.json b/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/zh-Hant.json index 4380b445..e42caad3 100644 --- a/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/zh-Hant.json +++ b/modules/EasyAbp.PaymentService.WeChatPay/src/EasyAbp.PaymentService.WeChatPay.Domain.Shared/EasyAbp/PaymentService/WeChatPay/Localization/WeChatPay/zh-Hant.json @@ -4,6 +4,9 @@ "Menu:PaymentService": "支付服務", "Menu:WeChatPayManagement": "微信支付", "Menu:RefundRecord": "退款記錄", + "Permission:PaymentServiceWeChatPay": "支付服務 - 微信支付", + "Permission:PaymentRecord": "付款記錄", + "Permission:RefundRecord": "退款紀錄", "RefundRecord": "退款記錄", "RefundRecordPaymentId": "支付 ID", "RefundRecordReturnCode": "ReturnCode", diff --git a/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Application.Contracts/EasyAbp/PaymentService/Authorization/PaymentServicePermissionDefinitionProvider.cs b/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Application.Contracts/EasyAbp/PaymentService/Authorization/PaymentServicePermissionDefinitionProvider.cs index 9e0c64f4..0fa806c8 100644 --- a/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Application.Contracts/EasyAbp/PaymentService/Authorization/PaymentServicePermissionDefinitionProvider.cs +++ b/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Application.Contracts/EasyAbp/PaymentService/Authorization/PaymentServicePermissionDefinitionProvider.cs @@ -11,17 +11,12 @@ public override void Define(IPermissionDefinitionContext context) var moduleGroup = context.AddGroup(PaymentServicePermissions.GroupName, L("Permission:PaymentService")); var payment = moduleGroup.AddPermission(PaymentServicePermissions.Payments.Default, L("Permission:Payment")); - payment.AddChild(PaymentServicePermissions.Payments.Manage, L("Permission:Manage")); - payment.AddChild(PaymentServicePermissions.Payments.Create, L("Permission:Create")); + payment.AddChild(PaymentServicePermissions.Payments.Manage.ManageDefault, L("Permission:Manage")); + payment.AddChild(PaymentServicePermissions.Payments.Manage.Cancel, L("Permission:Cancel")); + payment.AddChild(PaymentServicePermissions.Payments.Manage.RollbackRefund, L("Permission:RollbackRefund")); var refund = moduleGroup.AddPermission(PaymentServicePermissions.Refunds.Default, L("Permission:Refund")); refund.AddChild(PaymentServicePermissions.Refunds.Manage, L("Permission:Manage")); - refund.AddChild(PaymentServicePermissions.Refunds.Create, L("Permission:Create")); - - var withdrawalRecordPermission = moduleGroup.AddPermission(PaymentServicePermissions.WithdrawalRecord.Default, L("Permission:WithdrawalRecord")); - withdrawalRecordPermission.AddChild(PaymentServicePermissions.WithdrawalRecord.Create, L("Permission:Create")); - withdrawalRecordPermission.AddChild(PaymentServicePermissions.WithdrawalRecord.Update, L("Permission:Update")); - withdrawalRecordPermission.AddChild(PaymentServicePermissions.WithdrawalRecord.Delete, L("Permission:Delete")); } private static LocalizableString L(string name) diff --git a/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Application.Contracts/EasyAbp/PaymentService/Authorization/PaymentServicePermissions.cs b/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Application.Contracts/EasyAbp/PaymentService/Authorization/PaymentServicePermissions.cs index d421b1e1..13145678 100644 --- a/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Application.Contracts/EasyAbp/PaymentService/Authorization/PaymentServicePermissions.cs +++ b/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Application.Contracts/EasyAbp/PaymentService/Authorization/PaymentServicePermissions.cs @@ -10,27 +10,23 @@ public static string[] GetAll() { return ReflectionHelper.GetPublicConstantsRecursively(typeof(PaymentServicePermissions)); } - + public class Payments { public const string Default = GroupName + ".Payment"; - public const string Manage = Default + ".Manage"; - public const string Create = Default + ".Create"; + + public class Manage + { + public const string ManageDefault = Default + ".Manage"; + public const string Cancel = ManageDefault + ".Cancel"; + public const string RollbackRefund = ManageDefault + ".RollbackRefund"; + } } - + public class Refunds { public const string Default = GroupName + ".Refund"; public const string Manage = Default + ".Manage"; - public const string Create = Default + ".Create"; - } - - public class WithdrawalRecord - { - public const string Default = GroupName + ".WithdrawalRecord"; - public const string Update = Default + ".Update"; - public const string Create = Default + ".Create"; - public const string Delete = Default + ".Delete"; } } -} +} \ No newline at end of file diff --git a/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Application/EasyAbp/PaymentService/Payments/PaymentAppService.cs b/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Application/EasyAbp/PaymentService/Payments/PaymentAppService.cs index fcace096..bd42edbb 100644 --- a/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Application/EasyAbp/PaymentService/Payments/PaymentAppService.cs +++ b/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Application/EasyAbp/PaymentService/Payments/PaymentAppService.cs @@ -50,7 +50,7 @@ public override async Task GetAsync(Guid id) if (entity.UserId != CurrentUser.GetId()) { - await AuthorizationService.CheckAsync(PaymentServicePermissions.Payments.Manage); + await AuthorizationService.CheckAsync(PaymentServicePermissions.Payments.Manage.ManageDefault); } return await MapToGetOutputDtoAsync(entity); @@ -62,7 +62,7 @@ public override async Task> GetListAsync(GetPaymentLi if (!input.UserId.HasValue || input.UserId.Value != CurrentUser.GetId()) { - await AuthorizationService.CheckAsync(PaymentServicePermissions.Payments.Manage); + await AuthorizationService.CheckAsync(PaymentServicePermissions.Payments.Manage.ManageDefault); } var query = await CreateFilteredQueryAsync(input); @@ -128,7 +128,7 @@ public virtual async Task CancelAsync(Guid id) var payment = await _repository.GetAsync(id); if (payment.UserId != CurrentUser.GetId() && - !await AuthorizationService.IsGrantedAsync(PaymentServicePermissions.Payments.Manage)) + !await AuthorizationService.IsGrantedAsync(PaymentServicePermissions.Payments.Manage.Cancel)) { throw new UsingUnauthorizedPaymentException(CurrentUser.GetId(), payment.Id); } @@ -138,7 +138,7 @@ public virtual async Task CancelAsync(Guid id) return await MapToGetOutputDtoAsync(payment); } - [Authorize(PaymentServicePermissions.Payments.Manage)] + [Authorize(PaymentServicePermissions.Payments.Manage.Cancel)] public async Task RefundRollbackAsync(Guid id) { var payment = await _repository.GetAsync(id); diff --git a/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/cs.json b/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/cs.json index e8c93522..f7e791c2 100644 --- a/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/cs.json +++ b/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/cs.json @@ -3,6 +3,12 @@ "texts": { "Menu:PaymentService": "Payment service", "Menu:Payment": "Payment", + "Permission:PaymentService": "Payment service", + "Permission:Payment": "Payment", + "Permission:Manage": "Manage", + "Permission:Cancel": "Cancel", + "Permission:RollbackRefund": "Rollback refund", + "Permission:Refund": "Refund", "Payment": "Payment", "PaymentPaymentMethod": "Payment method", "PaymentExternalTradingCode": "External trading code", diff --git a/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/en.json b/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/en.json index fc0b0e2d..4f5efdf6 100644 --- a/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/en.json +++ b/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/en.json @@ -3,6 +3,12 @@ "texts": { "Menu:PaymentService": "Payment service", "Menu:Payment": "Payment", + "Permission:PaymentService": "Payment service", + "Permission:Payment": "Payment", + "Permission:Manage": "Manage", + "Permission:Cancel": "Cancel", + "Permission:RollbackRefund": "Rollback refund", + "Permission:Refund": "Refund", "Payment": "Payment", "PaymentPaymentMethod": "Payment method", "PaymentExternalTradingCode": "External trading code", diff --git a/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/pl.json b/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/pl.json index a709adf2..5b702bca 100644 --- a/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/pl.json +++ b/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/pl.json @@ -3,6 +3,12 @@ "texts": { "Menu:PaymentService": "Payment service", "Menu:Payment": "Payment", + "Permission:PaymentService": "Payment service", + "Permission:Payment": "Payment", + "Permission:Manage": "Manage", + "Permission:Cancel": "Cancel", + "Permission:RollbackRefund": "Rollback refund", + "Permission:Refund": "Refund", "Payment": "Payment", "PaymentPaymentMethod": "Payment method", "PaymentExternalTradingCode": "External trading code", diff --git a/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/pt-BR.json b/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/pt-BR.json index c9614e33..dadaa895 100644 --- a/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/pt-BR.json +++ b/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/pt-BR.json @@ -3,6 +3,12 @@ "texts": { "Menu:PaymentService": "Payment service", "Menu:Payment": "Payment", + "Permission:PaymentService": "Payment service", + "Permission:Payment": "Payment", + "Permission:Manage": "Manage", + "Permission:Cancel": "Cancel", + "Permission:RollbackRefund": "Rollback refund", + "Permission:Refund": "Refund", "Payment": "Payment", "PaymentPaymentMethod": "Payment method", "PaymentExternalTradingCode": "External trading code", diff --git a/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/sl.json b/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/sl.json index aef34980..d3130d75 100644 --- a/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/sl.json +++ b/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/sl.json @@ -3,6 +3,12 @@ "texts": { "Menu:PaymentService": "Payment service", "Menu:Payment": "Payment", + "Permission:PaymentService": "Payment service", + "Permission:Payment": "Payment", + "Permission:Manage": "Manage", + "Permission:Cancel": "Cancel", + "Permission:RollbackRefund": "Rollback refund", + "Permission:Refund": "Refund", "Payment": "Payment", "PaymentPaymentMethod": "Payment method", "PaymentExternalTradingCode": "External trading code", diff --git a/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/tr.json b/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/tr.json index df2580c5..ddc95661 100644 --- a/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/tr.json +++ b/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/tr.json @@ -3,6 +3,12 @@ "texts": { "Menu:PaymentService": "Payment service", "Menu:Payment": "Payment", + "Permission:PaymentService": "Payment service", + "Permission:Payment": "Payment", + "Permission:Manage": "Manage", + "Permission:Cancel": "Cancel", + "Permission:RollbackRefund": "Rollback refund", + "Permission:Refund": "Refund", "Payment": "Payment", "PaymentPaymentMethod": "Payment method", "PaymentExternalTradingCode": "External trading code", diff --git a/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/vi.json b/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/vi.json index 84483f0f..53ae4857 100644 --- a/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/vi.json +++ b/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/vi.json @@ -3,6 +3,12 @@ "texts": { "Menu:PaymentService": "Payment service", "Menu:Payment": "Payment", + "Permission:PaymentService": "Payment service", + "Permission:Payment": "Payment", + "Permission:Manage": "Manage", + "Permission:Cancel": "Cancel", + "Permission:RollbackRefund": "Rollback refund", + "Permission:Refund": "Refund", "Payment": "Payment", "PaymentPaymentMethod": "Payment method", "PaymentExternalTradingCode": "External trading code", diff --git a/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/zh-Hans.json b/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/zh-Hans.json index 3541ddea..016063d6 100644 --- a/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/zh-Hans.json +++ b/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/zh-Hans.json @@ -3,6 +3,12 @@ "texts": { "Menu:PaymentService": "支付服务", "Menu:Payment": "支付", + "Permission:PaymentService": "支付服务", + "Permission:Payment": "支付", + "Permission:Manage": "管理", + "Permission:Cancel": "取消", + "Permission:RollbackRefund": "回滚退款", + "Permission:Refund": "退款", "Payment": "支付", "PaymentPaymentMethod": "支付方式", "PaymentExternalTradingCode": "外部交易编号", diff --git a/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/zh-Hant.json b/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/zh-Hant.json index 9448f14f..0e0d065f 100644 --- a/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/zh-Hant.json +++ b/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Domain.Shared/EasyAbp/PaymentService/Localization/PaymentService/zh-Hant.json @@ -3,6 +3,12 @@ "texts": { "Menu:PaymentService": "支付服務", "Menu:Payment": "支付", + "Permission:PaymentService": "支付服務", + "Permission:Payment": "付款", + "Permission:Manage": "管理", + "Permission:Cancel": "取消", + "Permission:RollbackRefund": "回溯退款", + "Permission:Refund": "退款", "Payment": "支付", "PaymentPaymentMethod": "支付方式", "PaymentExternalTradingCode": "外部交易編號", diff --git a/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Web/Menus/PaymentServiceMenuContributor.cs b/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Web/Menus/PaymentServiceMenuContributor.cs index 0f835e11..46c8e2c7 100644 --- a/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Web/Menus/PaymentServiceMenuContributor.cs +++ b/modules/EasyAbp.PaymentService/src/EasyAbp.PaymentService.Web/Menus/PaymentServiceMenuContributor.cs @@ -23,7 +23,7 @@ private async Task ConfigureMainMenu(MenuConfigurationContext context) var paymentManagementMenuItem = new ApplicationMenuItem(PaymentServiceMenus.Prefix, l["Menu:PaymentService"], icon: "fa fa-credit-card"); - if (await context.IsGrantedAsync(PaymentServicePermissions.Payments.Manage)) + if (await context.IsGrantedAsync(PaymentServicePermissions.Payments.Manage.ManageDefault)) { paymentManagementMenuItem.AddItem( new ApplicationMenuItem(PaymentServiceMenus.Payment, l["Menu:Payment"], "/PaymentService/Payments/Payment")