2026-10-17 04:02:47 +02:00
|
|
|
using MongoDB.Entities;
|
|
|
|
|
|
|
|
|
|
namespace PrivaPub.Models
|
|
|
|
|
{
|
|
|
|
|
// One act of the server's staff, kept for the moderators' log (Domain/Moderation/ModerationLog.cs, completion program
|
|
|
|
|
// R5): who (an administrator's or moderator's root id, or "cli" for the command line), what, and on what. Never an IP
|
|
|
|
|
// address, and never a root next to its own personas: an entry about a persona drops the acting root when the persona
|
|
|
|
|
// is that root's, and an entry about a root names none of its personas. A backup holds the log and a restore keeps
|
|
|
|
|
// every entry made since (ProtectiveMerge).
|
|
|
|
|
public class AdminAction : Entity
|
|
|
|
|
{
|
|
|
|
|
public const string Cli = "cli";
|
|
|
|
|
|
|
|
|
|
public DateTime At { get; set; } = DateTime.UtcNow;
|
|
|
|
|
public string ByRootId { get; set; }
|
|
|
|
|
public string Action { get; set; }//AdminActions.*
|
|
|
|
|
public string TargetKind { get; set; }//AdminTargets.*
|
|
|
|
|
public string TargetId { get; set; }
|
|
|
|
|
public string TargetLabel { get; set; }
|
|
|
|
|
public string ReportId { get; set; }
|
|
|
|
|
public string Note { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static class AdminActions
|
|
|
|
|
{
|
|
|
|
|
public const string DomainBlockInsert = "domain_block.insert";
|
|
|
|
|
public const string DomainBlockDelete = "domain_block.delete";
|
|
|
|
|
public const string BackupCreate = "backup.create";
|
|
|
|
|
public const string BackupDelete = "backup.delete";
|
|
|
|
|
public const string BackupRestore = "backup.restore";
|
|
|
|
|
public const string SettingsUpdate = "settings.update";
|
|
|
|
|
public const string SettingsThumbnail = "settings.thumbnail";
|
|
|
|
|
public const string RuleInsert = "rule.insert";
|
|
|
|
|
public const string RuleUpdate = "rule.update";
|
|
|
|
|
public const string RuleDelete = "rule.delete";
|
|
|
|
|
public const string AnnouncementInsert = "announcement.insert";
|
|
|
|
|
public const string AnnouncementUpdate = "announcement.update";
|
|
|
|
|
public const string AnnouncementDelete = "announcement.delete";
|
|
|
|
|
public const string RelayInsert = "relay.insert";
|
|
|
|
|
public const string RelayDelete = "relay.delete";
|
|
|
|
|
public const string ReportResolve = "report.resolve";
|
|
|
|
|
public const string RootPromote = "root.promote";
|
|
|
|
|
public const string RootDemote = "root.demote";
|
|
|
|
|
public const string RootCreate = "root.create";
|
|
|
|
|
public const string RootDelete = "root.delete";
|
|
|
|
|
public const string RootResetTotp = "root.reset_totp";
|
|
|
|
|
public const string PersonaMove = "persona.move";
|
2026-10-17 05:23:45 +02:00
|
|
|
// moderation (completion program R6)
|
|
|
|
|
public const string RootRole = "root.role";
|
|
|
|
|
public const string RootBan = "root.ban";
|
|
|
|
|
public const string RootUnban = "root.unban";
|
|
|
|
|
public const string PersonaSilence = "persona.silence";
|
|
|
|
|
public const string PersonaUnsilence = "persona.unsilence";
|
|
|
|
|
public const string PersonaSuspend = "persona.suspend";
|
|
|
|
|
public const string PersonaUnsuspend = "persona.unsuspend";
|
|
|
|
|
public const string PersonaDelete = "persona.delete";
|
|
|
|
|
public const string AccountSilence = "account.silence";
|
|
|
|
|
public const string AccountUnsilence = "account.unsilence";
|
|
|
|
|
public const string AccountSuspend = "account.suspend";
|
|
|
|
|
public const string AccountUnsuspend = "account.unsuspend";
|
|
|
|
|
public const string GroupDelete = "group.delete";
|
|
|
|
|
public const string PostRemove = "post.remove";
|
2026-10-17 04:02:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static class AdminTargets
|
|
|
|
|
{
|
|
|
|
|
public const string Root = "root";
|
|
|
|
|
public const string Persona = "persona";
|
|
|
|
|
public const string Account = "account";
|
|
|
|
|
public const string Domain = "domain";
|
|
|
|
|
public const string Report = "report";
|
|
|
|
|
public const string Settings = "settings";
|
|
|
|
|
public const string Rule = "rule";
|
|
|
|
|
public const string Announcement = "announcement";
|
|
|
|
|
public const string Emoji = "emoji";
|
|
|
|
|
public const string Relay = "relay";
|
|
|
|
|
public const string Backup = "backup";
|
2026-10-17 05:23:45 +02:00
|
|
|
public const string Group = "group";
|
|
|
|
|
public const string Post = "post";
|
2026-10-17 04:02:47 +02:00
|
|
|
}
|
|
|
|
|
}
|