fix bug with privileged users not always showing the most recent profile
temporary bans are now applied to all linked accounts instead of a per-guid basis rework set level flow add guid and ip address (if logged in) to public async endpoint
This commit is contained in:
@ -45,7 +45,6 @@ namespace SharedLibraryCore.Services
|
||||
OriginEntityId = e.Origin.ClientId,
|
||||
TargetEntityId = e.Target?.ClientId ?? 0,
|
||||
Comment = "Executed command",
|
||||
PreviousValue = "",
|
||||
CurrentValue = e.Message,
|
||||
TypeOfChange = EFChangeHistory.ChangeType.Command
|
||||
};
|
||||
@ -56,8 +55,7 @@ namespace SharedLibraryCore.Services
|
||||
OriginEntityId = e.Origin.ClientId,
|
||||
TargetEntityId = e.Target.ClientId,
|
||||
TypeOfChange = EFChangeHistory.ChangeType.Permission,
|
||||
PreviousValue = ((Change)e.Extra).PreviousValue,
|
||||
CurrentValue = ((Change)e.Extra).NewValue
|
||||
CurrentValue = ((EFClient.Permission)e.Extra).ToString()
|
||||
};
|
||||
break;
|
||||
default:
|
||||
|
@ -21,7 +21,6 @@ namespace SharedLibraryCore.Services
|
||||
{
|
||||
Level = Permission.User,
|
||||
FirstConnection = DateTime.UtcNow,
|
||||
Connections = 1,
|
||||
LastConnection = DateTime.UtcNow,
|
||||
Masked = false,
|
||||
NetworkId = entity.NetworkId,
|
||||
@ -356,11 +355,25 @@ namespace SharedLibraryCore.Services
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// retrieves the number of owners
|
||||
/// (client level is owner)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<int> GetOwnerCount()
|
||||
{
|
||||
using (var ctx = new DatabaseContext(true))
|
||||
{
|
||||
return await ctx.Clients.AsNoTracking()
|
||||
.CountAsync(_client => _client.Level == Permission.Owner);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<List<EFClient>> GetPrivilegedClients()
|
||||
{
|
||||
using (var context = new DatabaseContext(disableTracking: true))
|
||||
{
|
||||
var iqClients = from client in context.Clients
|
||||
var iqClients = from client in context.Clients.AsNoTracking()
|
||||
where client.Level >= Permission.Trusted
|
||||
where client.Active
|
||||
select new EFClient()
|
||||
|
Reference in New Issue
Block a user