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

@@ -13,8 +13,7 @@ pub(crate) mod urls;
pub mod user_adapter;
pub mod watchlist_handler;
pub const INSTANCE_ACTOR_ID: uuid::Uuid =
uuid::Uuid::from_bytes([0, 0, 0, 0, 0, 0, 0x40, 0, 0x80, 0, 0, 0, 0, 0, 0, 0]);
pub const INSTANCE_ACTOR_ID: uuid::Uuid = domain::value_objects::SERVICE_ACTOR_UUID;
pub use k_ap::{
ActivityPubService, ActivityRepository, ActorRepository, ApContentReader, ApFederationConfig,

View File

@@ -151,6 +151,7 @@ pub async fn get_user_profile(
}
},
is_federated: false,
is_service_account: domain::value_objects::UserId::from_uuid(user_id).is_service_actor(),
handle: Some(profile.identity.handle.clone()),
actor_url: Some(profile.identity.actor_url.clone()),
})
@@ -227,6 +228,7 @@ async fn build_federated_profile_response(
view_data,
goals: None,
is_federated: true,
is_service_account: false,
handle: Some(fed.handle),
actor_url: Some(fed.actor_url),
})

View File

@@ -243,6 +243,8 @@ pub async fn get_user_profile_html(
heatmap,
page_items: pag.page_items,
is_own_profile,
is_service_account: domain::value_objects::UserId::from_uuid(profile_user_uuid)
.is_service_actor(),
error: params.error,
following_count: profile.following_count,
followers_count: profile.followers_count,

View File

@@ -56,6 +56,7 @@ pub struct ProfileTemplate<'a> {
pub heatmap: Vec<HeatmapCell>,
pub page_items: Vec<PageItem>,
pub is_own_profile: bool,
pub is_service_account: bool,
pub error: Option<String>,
pub following_count: usize,
pub followers_count: usize,

View File

@@ -97,7 +97,7 @@
</section>
{% endif %}
{% if ctx.is_admin && !is_own_profile %}
{% if ctx.is_admin && !is_own_profile && !is_service_account %}
<section class="profile-manage">
<h3>Admin</h3>
{% if let Some(err) = error %}