1
0

IAdminManager.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. using Content.Shared.Administration;
  2. using Content.Shared.Administration.Managers;
  3. using Robust.Shared.Player;
  4. using Robust.Shared.Toolshed;
  5. namespace Content.Server.Administration.Managers
  6. {
  7. /// <summary>
  8. /// Manages server administrators and their permission flags.
  9. /// </summary>
  10. public interface IAdminManager : ISharedAdminManager
  11. {
  12. /// <summary>
  13. /// Fired when the permissions of an admin on the server changed.
  14. /// </summary>
  15. event Action<AdminPermsChangedEventArgs> OnPermsChanged;
  16. /// <summary>
  17. /// Gets all active admins currently on the server.
  18. /// </summary>
  19. /// <remarks>
  20. /// This does not include admins that are de-adminned.
  21. /// </remarks>
  22. IEnumerable<ICommonSession> ActiveAdmins { get; }
  23. /// <summary>
  24. /// Gets all admins currently on the server, even de-adminned ones.
  25. /// </summary>
  26. IEnumerable<ICommonSession> AllAdmins { get; }
  27. /// <summary>
  28. /// De-admins an admin temporarily so they are effectively a normal player.
  29. /// </summary>
  30. /// <remarks>
  31. /// De-adminned admins are able to re-admin at any time if they so desire.
  32. /// </remarks>
  33. void DeAdmin(ICommonSession session);
  34. /// <summary>
  35. /// Re-admins a de-adminned admin.
  36. /// </summary>
  37. void ReAdmin(ICommonSession session);
  38. /// <summary>
  39. /// Make admin hidden from adminwho.
  40. /// </summary>
  41. void Stealth(ICommonSession session);
  42. /// <summary>
  43. /// Unhide admin from adminwho.
  44. /// </summary>
  45. void UnStealth(ICommonSession session);
  46. /// <summary>
  47. /// Re-loads the permissions of an player in case their admin data changed DB-side.
  48. /// </summary>
  49. /// <seealso cref="ReloadAdminsWithRank"/>
  50. void ReloadAdmin(ICommonSession player);
  51. /// <summary>
  52. /// Reloads admin permissions for all admins with a certain rank.
  53. /// </summary>
  54. /// <param name="rankId">The database ID of the rank.</param>
  55. /// <seealso cref="ReloadAdmin"/>
  56. void ReloadAdminsWithRank(int rankId);
  57. void Initialize();
  58. void PromoteHost(ICommonSession player);
  59. bool TryGetCommandFlags(CommandSpec command, out AdminFlags[]? flags);
  60. }
  61. }