update:删除原先获取角色权限得代码
This commit is contained in:
@@ -15,7 +15,6 @@ namespace Ewide.Core.Service
|
||||
Task<dynamic> GetOrgTree([FromQuery] OrgInput input);
|
||||
Task<dynamic> QueryOrgPageList([FromQuery] PageOrgInput input);
|
||||
Task UpdateOrg(UpdateOrgInput input);
|
||||
Task<List<string>> GetUserDataScopeIdList();
|
||||
/// <summary>
|
||||
/// 根据区域信息获取单位id
|
||||
/// </summary>
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Ewide.Core.Service
|
||||
[HttpPost("/sysOrg/page")]
|
||||
public async Task<dynamic> QueryOrgPageList([FromBody] PageOrgInput input)
|
||||
{
|
||||
var dataScopeList = GetDataScopeList(await GetUserDataScopeIdList());
|
||||
var dataScopeList = GetDataScopeList(await _userManager.GetUserAllDataScopeList());
|
||||
|
||||
var name = !string.IsNullOrEmpty(input.Name?.Trim());
|
||||
var id = !string.IsNullOrEmpty(input.Id?.Trim());
|
||||
@@ -107,7 +107,7 @@ namespace Ewide.Core.Service
|
||||
[HttpGet("/sysOrg/list")]
|
||||
public async Task<List<OrgOutput>> GetOrgList([FromQuery] OrgInput input)
|
||||
{
|
||||
var dataScopeList = GetDataScopeList(await GetUserDataScopeIdList());
|
||||
var dataScopeList = GetDataScopeList(await _userManager.GetUserAllDataScopeList());
|
||||
|
||||
var pId = !string.IsNullOrEmpty(input.Pid?.Trim());
|
||||
var orgs = await _sysOrgRep.DetachedEntities
|
||||
@@ -136,7 +136,7 @@ namespace Ewide.Core.Service
|
||||
if (input.Pid != "0" && !string.IsNullOrEmpty(input.Pid))
|
||||
{
|
||||
// 新增组织机构的父机构不在自己的数据范围内
|
||||
var dataScopes = await GetUserDataScopeIdList();
|
||||
var dataScopes = await _userManager.GetUserAllDataScopeList();
|
||||
if (dataScopes.Count < 1 || !dataScopes.Contains(input.Pid))
|
||||
throw Oops.Oh(ErrorCode.D2003);
|
||||
}
|
||||
@@ -179,7 +179,7 @@ namespace Ewide.Core.Service
|
||||
var sysOrg = await _sysOrgRep.DetachedEntities.FirstOrDefaultAsync(u => u.Id == input.Id);
|
||||
|
||||
// 检测数据范围能不能操作这个机构
|
||||
var dataScopes = await GetUserDataScopeIdList();
|
||||
var dataScopes = await _userManager.GetUserAllDataScopeList();
|
||||
if (!_userManager.SuperAdmin && (dataScopes.Count < 1 || !dataScopes.Contains(sysOrg.Id)))
|
||||
throw Oops.Oh(ErrorCode.D2003);
|
||||
|
||||
@@ -233,7 +233,7 @@ namespace Ewide.Core.Service
|
||||
var sysOrg = await _sysOrgRep.DetachedEntities.FirstOrDefaultAsync(u => u.Id == input.Id);
|
||||
|
||||
// 检测数据范围能不能操作这个机构
|
||||
var dataScopes = await GetUserDataScopeIdList();
|
||||
var dataScopes = await _userManager.GetUserAllDataScopeList();
|
||||
if (!_userManager.SuperAdmin && (dataScopes.Count < 1 || !dataScopes.Contains(sysOrg.Id)))
|
||||
throw Oops.Oh(ErrorCode.D2003);
|
||||
|
||||
@@ -293,7 +293,7 @@ namespace Ewide.Core.Service
|
||||
var dataScopeList = new List<string>();
|
||||
if (!_userManager.SuperAdmin)
|
||||
{
|
||||
var dataScopes = await GetUserDataScopeIdList();
|
||||
var dataScopes = await _userManager.GetUserAllDataScopeList();
|
||||
if (dataScopes.Count < 1)
|
||||
return dataScopeList;
|
||||
dataScopeList = GetDataScopeList(dataScopes);
|
||||
@@ -344,17 +344,6 @@ namespace Ewide.Core.Service
|
||||
}
|
||||
return orgIdList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取用户数据范围(机构Id集合)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[NonAction]
|
||||
public async Task<List<string>> GetUserDataScopeIdList()
|
||||
{
|
||||
return await App.GetService<ISysUserService>().GetUserDataScopeIdList();
|
||||
}
|
||||
|
||||
public async Task<List<string>> GetAreaDataScopeIdList(int dataScopeType, string orgId)
|
||||
{
|
||||
var org = await _sysOrgRep.FirstOrDefaultAsync(o => o.Id == orgId);
|
||||
|
||||
Reference in New Issue
Block a user