honcho: plugin web pages with i18n, defer plugin detail to custom admin page
Nightly Build / build (push) Failing after 6m13s

This commit is contained in:
2026-07-20 15:29:26 +01:00
parent 8edac4de99
commit 6040f9a339
22 changed files with 927 additions and 2 deletions
+12
View File
@@ -186,6 +186,18 @@ impl UserChannelApi for Skald {
.unwrap_or(false)
}
async fn is_admin(&self, user_id: &str) -> bool {
// Built-in admin role; an unknown user or a lookup error fails closed.
sqlx::query_as::<_, (String,)>("SELECT role_id FROM users WHERE id = ?")
.bind(user_id)
.fetch_optional(self.db().as_ref())
.await
.ok()
.flatten()
.map(|(r,)| r == crate::db::roles::ADMIN_ROLE_ID)
.unwrap_or(false)
}
async fn user_for_session(&self, token: &str) -> Option<String> {
self.sessions().user_of(token)
}