fix admin数据权限问题

This commit is contained in:
2024-07-03 14:59:00 +08:00
parent 435e82c2c0
commit 79e4e9a211

View File

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