feat(plugins): plugin pages, per-user config, capabilities gate, mobile/telegram refactors
- Plugin HTTP routes + web pages (plugin-page-host, plugin-catalog, plugin-detail) - Plugin access grants + per-user config (DB tables + API + frontend forms) - Capabilities-based guard (caps.rs) replacing role-id checks - Mobile connector: message routing, payload types, router refactor - Telegram bot: auth flow, event handling improvements - Honcho plugin: substantial rework - Sidebar: plugin pages integration, role-driven visibility - i18n: new strings for plugins, connectors, capabilities - Remove unused mascot asset
This commit is contained in:
@@ -177,4 +177,16 @@ impl UserChannelApi for Skald {
|
||||
let ctx = self.user_context(user_id).await?;
|
||||
Some(std::sync::Arc::new(UserContextHandle::new(ctx)))
|
||||
}
|
||||
|
||||
async fn plugin_access(&self, plugin_id: &str, user_id: &str) -> bool {
|
||||
// Admin short-circuit + grant lookup live in `db::plugin_access`; a
|
||||
// lookup error fails closed.
|
||||
crate::db::plugin_access::effective_access(self.db(), plugin_id, user_id)
|
||||
.await
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
async fn user_for_session(&self, token: &str) -> Option<String> {
|
||||
self.sessions().user_of(token)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user