adds toggles for accessreaders (#5696)

This commit is contained in:
Flipp Syder
2021-12-04 01:01:37 -08:00
committed by GitHub
parent 787c82b412
commit 863a85cef6
2 changed files with 8 additions and 1 deletions

View File

@@ -25,6 +25,13 @@ namespace Content.Server.Access.Components
{ {
public override string Name => "AccessReader"; public override string Name => "AccessReader";
/// <summary>
/// Whether this reader is enabled or not. If disabled, all access
/// checks will pass.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public bool Enabled = true;
/// <summary> /// <summary>
/// The set of tags that will automatically deny an allowed check, if any of them are present. /// The set of tags that will automatically deny an allowed check, if any of them are present.
/// </summary> /// </summary>

View File

@@ -60,7 +60,7 @@ namespace Content.Server.Access.Systems
return false; return false;
} }
return reader.AccessLists.Count == 0 || reader.AccessLists.Any(a => a.IsSubsetOf(accessTags)); return !reader.Enabled || reader.AccessLists.Count == 0 || reader.AccessLists.Any(a => a.IsSubsetOf(accessTags));
} }
public ICollection<string> FindAccessTags(EntityUid uid) public ICollection<string> FindAccessTags(EntityUid uid)