diff --git a/Content.Shared/Access/Systems/AccessReaderSystem.cs b/Content.Shared/Access/Systems/AccessReaderSystem.cs index fbbf67c171..ea66232c65 100644 --- a/Content.Shared/Access/Systems/AccessReaderSystem.cs +++ b/Content.Shared/Access/Systems/AccessReaderSystem.cs @@ -50,6 +50,20 @@ namespace Content.Shared.Access.Systems args.Handled = true; } } + /// + /// Searches the source for access tags + /// then compares it with the targets readers access list to see if it is allowed. + /// + /// The entity that wants access. + /// The entity to search for an access reader + /// Optional reader from the target entity + public bool IsAllowed(EntityUid source, EntityUid target, AccessReaderComponent? reader = null) + { + if (!Resolve(target, ref reader, false)) + return true; + var tags = FindAccessTags(source); + return IsAllowed(tags, reader); + } /// /// Searches the given entity for access tags