From 1b00f4ba8652f859d069f8b443d6eb30f5cc9e9b Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 20 Feb 2024 07:06:37 +0800 Subject: [PATCH] chore: disable collab ac --- libs/realtime/src/collaborate/plugin.rs | 3 +- src/biz/casbin/collab_ac.rs | 43 +++++++++++++------------ 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/libs/realtime/src/collaborate/plugin.rs b/libs/realtime/src/collaborate/plugin.rs index 4acdc0fc..d5abee81 100644 --- a/libs/realtime/src/collaborate/plugin.rs +++ b/libs/realtime/src/collaborate/plugin.rs @@ -113,7 +113,7 @@ async fn init_collab( // Can turn off INFO level into DEBUG. For now, just to see the log event!( - tracing::Level::INFO, + tracing::Level::DEBUG, "start decoding:{} state len: {}, sv len: {}, v: {:?}", oid, encoded_collab.doc_state.len(), @@ -125,7 +125,6 @@ async fn init_collab( txn.try_apply_update(update)?; drop(txn); - event!(tracing::Level::INFO, "finish decoding:{}: doc state", oid,); Ok(()) } diff --git a/src/biz/casbin/collab_ac.rs b/src/biz/casbin/collab_ac.rs index 5cb0817c..3941adba 100644 --- a/src/biz/casbin/collab_ac.rs +++ b/src/biz/casbin/collab_ac.rs @@ -1,4 +1,4 @@ -use crate::biz::casbin::access_control::{AccessControl, Action}; +use crate::biz::casbin::access_control::AccessControl; use crate::biz::casbin::access_control::{ActionType, ObjectType}; use actix_http::Method; use app_error::AppError; @@ -69,30 +69,31 @@ impl CollabAccessControl for CollabAccessControlImpl { async fn can_access_http_method( &self, - uid: &i64, - oid: &str, - method: &Method, + _uid: &i64, + _oid: &str, + _method: &Method, ) -> Result { - let action = Action::from(method); - self - .access_control - .enforce(uid, &ObjectType::Collab(oid), action) - .await + Ok(true) + // let action = Action::from(method); + // self + // .access_control + // .enforce(uid, &ObjectType::Collab(oid), action) + // .await } - async fn can_send_collab_update(&self, uid: &i64, oid: &str) -> Result { - // Ok(true) - self - .access_control - .enforce(uid, &ObjectType::Collab(oid), Action::Write) - .await + async fn can_send_collab_update(&self, _uid: &i64, _oid: &str) -> Result { + Ok(true) + // self + // .access_control + // .enforce(uid, &ObjectType::Collab(oid), Action::Write) + // .await } - async fn can_receive_collab_update(&self, uid: &i64, oid: &str) -> Result { - // Ok(true) - self - .access_control - .enforce(uid, &ObjectType::Collab(oid), Action::Read) - .await + async fn can_receive_collab_update(&self, _uid: &i64, _oid: &str) -> Result { + Ok(true) + // self + // .access_control + // .enforce(uid, &ObjectType::Collab(oid), Action::Read) + // .await } }