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) {