service actor undeletable: domain const, 403, hide delete UI

This commit is contained in:
2026-10-26 03:15:27 +01:00
parent 3861d99e1f
commit 9d0166f5cb
12 changed files with 85 additions and 4 deletions

View File

@@ -32,6 +32,20 @@ impl MovieId {
uuid_id!(ReviewId);
uuid_id!(UserId);
/// Id of the instance's service actor (seeded by migration 0022). It signs
/// fetches for the whole instance and is never a deletable account.
pub const SERVICE_ACTOR_UUID: Uuid =
Uuid::from_bytes([0, 0, 0, 0, 0, 0, 0x40, 0, 0x80, 0, 0, 0, 0, 0, 0, 0]);
impl UserId {
pub const fn service_actor() -> Self {
Self(SERVICE_ACTOR_UUID)
}
pub fn is_service_actor(&self) -> bool {
self.0 == SERVICE_ACTOR_UUID
}
}
uuid_id!(ImportSessionId);
uuid_id!(ImportProfileId);
uuid_id!(WatchlistEntryId);