2020-05-28 06:22:47 -05:00
|
|
|
using System;
|
2019-09-01 22:57:22 +02:00
|
|
|
using System.Collections.Generic;
|
2020-06-03 11:46:59 +02:00
|
|
|
using System.Linq;
|
2021-06-09 22:19:39 +02:00
|
|
|
using Content.Server.Hands.Components;
|
|
|
|
|
using Content.Server.Inventory.Components;
|
|
|
|
|
using Content.Server.Items;
|
2021-02-23 03:07:40 +01:00
|
|
|
using Content.Shared.Access;
|
2021-06-09 22:19:39 +02:00
|
|
|
using Content.Shared.Inventory;
|
2019-09-01 22:57:22 +02:00
|
|
|
using JetBrains.Annotations;
|
|
|
|
|
using Robust.Shared.GameObjects;
|
2021-02-23 03:07:40 +01:00
|
|
|
using Robust.Shared.IoC;
|
|
|
|
|
using Robust.Shared.Log;
|
|
|
|
|
using Robust.Shared.Prototypes;
|
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-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.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]
|
|
|
|
|
public class AccessReader : Component
|
|
|
|
|
{
|
|
|
|
|
public override string Name => "AccessReader";
|
2020-06-03 11:46:59 +02:00
|
|
|
|
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
|
|
|
}
|
|
|
|
|
}
|