diff --git a/Content.Server/Administration/BanList/BanListEui.cs b/Content.Server/Administration/BanList/BanListEui.cs index 3a86a42d531..8ddc7459d7b 100644 --- a/Content.Server/Administration/BanList/BanListEui.cs +++ b/Content.Server/Administration/BanList/BanListEui.cs @@ -65,13 +65,23 @@ private async Task LoadBans(NetUserId userId) unban = new SharedServerUnban(unbanningAdmin, ban.Unban.UnbanTime.UtcDateTime); } + (string, int cidrMask)? ip = ("*Hidden*", 0); + var hwid = "*Hidden*"; + + if (_admins.HasAdminFlag(Player, AdminFlags.Pii)) + { + ip = ban.Address is { } address + ? (address.address.ToString(), address.cidrMask) + : null; + + hwid = ban.HWId == null ? null : Convert.ToBase64String(ban.HWId.Value.AsSpan()); + } + Bans.Add(new SharedServerBan( ban.Id, ban.UserId, - ban.Address is { } address - ? (address.address.ToString(), address.cidrMask) - : null, - ban.HWId == null ? null : Convert.ToBase64String(ban.HWId.Value.AsSpan()), + ip, + hwid, ban.BanTime.UtcDateTime, ban.ExpirationTime?.UtcDateTime, ban.Reason, @@ -96,13 +106,22 @@ private async Task LoadRoleBans(NetUserId userId) unban = new SharedServerUnban(unbanningAdmin, ban.Unban.UnbanTime.UtcDateTime); } + (string, int cidrMask)? ip = ("*Hidden*", 0); + var hwid = "*Hidden*"; + + if (_admins.HasAdminFlag(Player, AdminFlags.Pii)) + { + ip = ban.Address is { } address + ? (address.address.ToString(), address.cidrMask) + : null; + + hwid = ban.HWId == null ? null : Convert.ToBase64String(ban.HWId.Value.AsSpan()); + } RoleBans.Add(new SharedServerRoleBan( ban.Id, ban.UserId, - ban.Address is { } address - ? (address.address.ToString(), address.cidrMask) - : null, - ban.HWId == null ? null : Convert.ToBase64String(ban.HWId.Value.AsSpan()), + ip, + hwid, ban.BanTime.UtcDateTime, ban.ExpirationTime?.UtcDateTime, ban.Reason, diff --git a/Content.Shared/Administration/AdminFlags.cs b/Content.Shared/Administration/AdminFlags.cs index d8973b08789..71a08a70dbf 100644 --- a/Content.Shared/Administration/AdminFlags.cs +++ b/Content.Shared/Administration/AdminFlags.cs @@ -105,6 +105,11 @@ public enum AdminFlags : uint /// Adminchat = 1 << 17, + /// + /// Permits the visibility of Pii in game and on SS14 Admin + /// + Pii = 1 << 18, + /// /// DeltaV - The ability to whitelist people. Either this permission or +BAN is required for remove. ///