From 2d1451f54354570be47cd6b7f345b3cf16a427d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ZR20090193-=E9=99=88=E6=95=AC=E5=8B=87?= Date: Tue, 20 Feb 2024 16:25:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E7=A7=9F=E6=88=B7=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=91=98=E6=96=B0=E5=A2=9E=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../System/Method/TenantService.cs | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/ds-wms-service/DS.WMS.Core/System/Method/TenantService.cs b/ds-wms-service/DS.WMS.Core/System/Method/TenantService.cs index 79684a54..88436077 100644 --- a/ds-wms-service/DS.WMS.Core/System/Method/TenantService.cs +++ b/ds-wms-service/DS.WMS.Core/System/Method/TenantService.cs @@ -96,9 +96,27 @@ public class TenantService : ITenantService IEnumerable addPermissions = req.PermissionIds.AsQueryable().Except(existPermissions); if (addPermissions.Count() > 0) - { + { var addPers = db.Queryable().Filter(null, true) .Where(x => addPermissions.Contains(x.Id)).ToList(); + + #region 处理租户管理员新增权限 + + var tenantRole = db.Queryable().Filter(null, true) + .Where(x => x.TenantId == req.TenantId && x.RoleCode == "tenantAdmin").First(); + //写入租户管理员权限 + var rolePerList = new List(); + foreach (var item in addPers) + { + var rolePer = item.Adapt(); + rolePer.RoleId = tenantRole.Id; + rolePer.PermissionId = item.Id; + rolePer.IsPermission = 1; + + rolePerList.Add(rolePer); + } + db.Insertable(rolePerList).ExecuteCommandAsync(); + #endregion 处理租户管理员新增权限 var tenantPerList = new List(); foreach (var item in addPers) {