2019-09-01 22:57:22 +02:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using Robust.Shared.GameObjects;
|
2021-03-05 01:08:38 +01:00
|
|
|
using Robust.Shared.Serialization.Manager.Attributes;
|
2019-09-01 22:57:22 +02:00
|
|
|
using Robust.Shared.ViewVariables;
|
|
|
|
|
|
2021-12-26 17:07:28 +13:00
|
|
|
namespace Content.Shared.Access.Components
|
2019-09-01 22:57:22 +02:00
|
|
|
{
|
2020-06-03 11:46:59 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Stores access levels necessary to "use" an entity
|
|
|
|
|
/// and allows checking if something or somebody is authorized with these access levels.
|
|
|
|
|
/// </summary>
|
2019-09-01 22:57:22 +02:00
|
|
|
[RegisterComponent]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class AccessReaderComponent : Component
|
2019-09-01 22:57:22 +02:00
|
|
|
{
|
2021-12-04 01:01:37 -08:00
|
|
|
/// <summary>
|
|
|
|
|
/// Whether this reader is enabled or not. If disabled, all access
|
|
|
|
|
/// checks will pass.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
public bool Enabled = true;
|
|
|
|
|
|
2021-10-22 05:31:07 +03:00
|
|
|
/// <summary>
|
|
|
|
|
/// The set of tags that will automatically deny an allowed check, if any of them are present.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public HashSet<string> DenyTags = new();
|
2020-06-03 11:46:59 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// List of access lists to check allowed against. For an access check to pass
|
|
|
|
|
/// there has to be an access list that is a subset of the access in the checking list.
|
|
|
|
|
/// </summary>
|
2021-05-04 15:37:16 +02:00
|
|
|
[DataField("access")]
|
2021-03-05 01:08:38 +01:00
|
|
|
[ViewVariables]
|
2021-10-22 05:31:07 +03:00
|
|
|
public List<HashSet<string>> AccessLists = new();
|
2019-09-01 22:57:22 +02:00
|
|
|
}
|
|
|
|
|
}
|