Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admins can now always see encryption keys details #33307

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Content.Shared/Radio/EntitySystems/EncryptionKeySystem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Linq;
using Content.Shared.Administration.Managers;
using Content.Shared.Chat;
using Content.Shared.DoAfter;
using Content.Shared.Examine;
Expand All @@ -23,6 +24,7 @@ namespace Content.Shared.Radio.EntitySystems;
/// </summary>
public sealed partial class EncryptionKeySystem : EntitySystem
{
[Dependency] private readonly ISharedAdminManager _admin = default!;
[Dependency] private readonly IPrototypeManager _protoManager = default!;
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly INetManager _net = default!;
Expand Down Expand Up @@ -174,7 +176,7 @@ private void OnStartup(EntityUid uid, EncryptionKeyHolderComponent component, Co

private void OnHolderExamined(EntityUid uid, EncryptionKeyHolderComponent component, ExaminedEvent args)
{
if (!args.IsInDetailsRange)
if (!args.IsInDetailsRange && !_admin.IsAdmin(args.Examiner))
return;

if (component.KeyContainer.ContainedEntities.Count == 0)
Expand All @@ -199,7 +201,7 @@ private void OnHolderExamined(EntityUid uid, EncryptionKeyHolderComponent compon

private void OnKeyExamined(EntityUid uid, EncryptionKeyComponent component, ExaminedEvent args)
{
if (!args.IsInDetailsRange)
if (!args.IsInDetailsRange && !_admin.IsAdmin(args.Examiner))
return;

if(component.Channels.Count > 0)
Expand Down
Loading