chore: apply cargo fmt across workspace and update docs
- Run cargo fmt on all Rust crates for consistent formatting - Update CLAUDE.md with WASM plugin commands and dev.ps1 instructions - Update wiki: add WASM plugin architecture, rewrite dev environment docs - Minor frontend cleanup (unused imports)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use axum::Json;
|
||||
use axum::http::StatusCode;
|
||||
use axum::response::{IntoResponse, Response};
|
||||
use axum::Json;
|
||||
use serde::Serialize;
|
||||
|
||||
/// 统一错误响应格式
|
||||
|
||||
@@ -57,7 +57,11 @@ impl ModuleRegistry {
|
||||
}
|
||||
|
||||
pub fn register(mut self, module: impl ErpModule + 'static) -> Self {
|
||||
tracing::info!(module = module.name(), version = module.version(), "Module registered");
|
||||
tracing::info!(
|
||||
module = module.name(),
|
||||
version = module.version(),
|
||||
"Module registered"
|
||||
);
|
||||
let mut modules = (*self.modules).clone();
|
||||
modules.push(Arc::new(module));
|
||||
self.modules = Arc::new(modules);
|
||||
|
||||
@@ -15,10 +15,7 @@ pub fn require_permission(ctx: &TenantContext, permission: &str) -> Result<(), A
|
||||
/// Check whether the `TenantContext` includes at least one of the specified permission codes.
|
||||
///
|
||||
/// Useful when multiple permissions can grant access to the same resource.
|
||||
pub fn require_any_permission(
|
||||
ctx: &TenantContext,
|
||||
permissions: &[&str],
|
||||
) -> Result<(), AppError> {
|
||||
pub fn require_any_permission(ctx: &TenantContext, permissions: &[&str]) -> Result<(), AppError> {
|
||||
let has_any = permissions
|
||||
.iter()
|
||||
.any(|p| ctx.permissions.iter().any(|up| up == *p));
|
||||
|
||||
Reference in New Issue
Block a user