using System; using System.Collections.Generic; using Content.Shared.Administration; using Robust.Server.Interfaces.Player; #nullable enable namespace Content.Server.Administration { /// /// Manages server administrators and their permission flags. /// public interface IAdminManager { /// /// Fired when the permissions of an admin on the server changed. /// event Action OnPermsChanged; /// /// Gets all active admins currently on the server. /// /// /// This does not include admins that are de-adminned. /// IEnumerable ActiveAdmins { get; } /// /// Gets the admin data for a player, if they are an admin. /// /// The player to get admin data for. /// /// Whether to return admin data for admins that are current de-adminned. /// /// if the player is not an admin. AdminData? GetAdminData(IPlayerSession session, bool includeDeAdmin = false); /// /// See if a player has an admin flag. /// /// True if the player is and admin and has the specified flags. bool HasAdminFlag(IPlayerSession player, AdminFlags flag) { var data = GetAdminData(player); return data != null && data.HasFlag(flag); } /// /// De-admins an admin temporarily so they are effectively a normal player. /// /// /// De-adminned admins are able to re-admin at any time if they so desire. /// void DeAdmin(IPlayerSession session); /// /// Re-admins a de-adminned admin. /// void ReAdmin(IPlayerSession session); /// /// Re-loads the permissions of an player in case their admin data changed DB-side. /// /// void ReloadAdmin(IPlayerSession player); /// /// Reloads admin permissions for all admins with a certain rank. /// /// The database ID of the rank. /// void ReloadAdminsWithRank(int rankId); void Initialize(); void PromoteHost(IPlayerSession player); } }