service actor undeletable: domain const, 403, hide delete UI
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user