using System;
using System.Collections.Generic;
using Content.Shared.Administration;
using Robust.Server.Player;
namespace Content.Server.Administration.Managers
{
///
/// 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; }
///
/// Checks if a player is an admin.
///
/// The player to check.
///
/// Whether to return admin data for admins that are current de-adminned.
///
/// true if the player is an admin, false otherwise.
bool IsAdmin(IPlayerSession session, bool includeDeAdmin = false);
///
/// 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);
}
}