fix admin数据权限问题
This commit is contained in:
@@ -23,8 +23,13 @@ public class GetDataPermissionService : IGetDataPermissions, ISingletonDependenc
|
|||||||
public Dictionary<string, List<Guid>> GetData<T>()
|
public Dictionary<string, List<Guid>> GetData<T>()
|
||||||
{
|
{
|
||||||
var dict = new Dictionary<string, List<Guid>>(2);
|
var dict = new Dictionary<string, List<Guid>>(2);
|
||||||
|
if (_currentUser.GetRole() == "admin")
|
||||||
|
{
|
||||||
|
return dict;
|
||||||
|
}
|
||||||
|
|
||||||
using var scope = _serviceProvider.CreateScope();
|
using var scope = _serviceProvider.CreateScope();
|
||||||
|
|
||||||
var db = scope.ServiceProvider.GetService<IDbContext>();
|
var db = scope.ServiceProvider.GetService<IDbContext>();
|
||||||
db.Ignore<ITenantId>(() =>
|
db.Ignore<ITenantId>(() =>
|
||||||
{
|
{
|
||||||
@@ -41,7 +46,6 @@ public class GetDataPermissionService : IGetDataPermissions, ISingletonDependenc
|
|||||||
.GetProperties()
|
.GetProperties()
|
||||||
.FirstOrDefault(x => x.IsDefined(typeof(DeviceGroupCodeAttribute), false));
|
.FirstOrDefault(x => x.IsDefined(typeof(DeviceGroupCodeAttribute), false));
|
||||||
|
|
||||||
|
|
||||||
var deviceCodes = new List<Guid>();
|
var deviceCodes = new List<Guid>();
|
||||||
|
|
||||||
//先计算分组权限下的设备
|
//先计算分组权限下的设备
|
||||||
|
|||||||
Reference in New Issue
Block a user