Script for automating a large assortment of AME related actions
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
782 B

9 months ago
  1. using System;
  2. using System.Threading;
  3. namespace amecs.Actions
  4. {
  5. public class Elevation
  6. {
  7. public static bool Elevate() => amecs.RunBasicAction("Elevating user to Administrator", "The current user is now an Administrator", new Action(() =>
  8. {
  9. Globals.Administrators.Members.Add(Globals.User);
  10. Globals.Administrators.Save();
  11. Thread.Sleep(1000);
  12. }), true);
  13. public static bool DeElevate() => amecs.RunBasicAction("Revoking Admin rights from the current user", "Admin rights have been revoked for the current user", new Action(() =>
  14. {
  15. Globals.Administrators.Members.Remove(Globals.User);
  16. Globals.Administrators.Save();
  17. Thread.Sleep(1000);
  18. }), true);
  19. }
  20. }