Files
tbd-station-14/Content.Server/Interfaces/IAccess.cs
Pieter-Jan Briers 0f43e5e6ad Access refactor
Access is now done through a list of access lists, instead of the necessary/sufficient system that was extremely confusing.

Added a "deny" list so you can screw over sec.

Cleaned the API up so it all uses sets and such.

PDA now relays access read-only to fix edge cases.
2020-06-03 11:46:59 +02:00

35 lines
1.1 KiB
C#

using System;
using Content.Server.GameObjects.Components.Access;
using System.Collections.Generic;
#nullable enable
namespace Content.Server.Interfaces
{
/// <summary>
/// Contains access levels that can be checked to see if somebody has access with an <see cref="AccessReader"/>.
/// </summary>
public interface IAccess
{
/// <summary>
/// The set of access tags this thing has.
/// </summary>
/// <remarks>
/// This set may be read-only. Check <see cref="IsReadOnly"/> if you want to mutate it.
/// </remarks>
ISet<string> Tags { get; }
/// <summary>
/// Whether the <see cref="Tags"/> list is read-only.
/// </summary>
bool IsReadOnly { get; }
/// <summary>
/// Replaces the set of access tags we have with the provided set.
/// </summary>
/// <param name="newTags">The new access tags</param>
/// <exception cref="NotSupportedException">If this access tag list is read-only.</exception>
void SetTags(IEnumerable<string> newTags);
}
}