chore: add disable collab ac feature flag (#336)
This commit is contained in:
parent
399f7ba2b5
commit
cbcf43081f
|
|
@ -179,6 +179,8 @@ collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev
|
|||
|
||||
[features]
|
||||
custom_env= []
|
||||
# This feature will be removed once the cpu spike issue is resolved
|
||||
disable_collab_ac = []
|
||||
|
||||
# Comment the above and uncomment the below to use local version of collab by cloning the repo and placing it in libs folder
|
||||
#collab = { path = "libs/AppFlowy-Collab/collab" }
|
||||
|
|
|
|||
|
|
@ -16,7 +16,8 @@ COPY . .
|
|||
ENV SQLX_OFFLINE true
|
||||
|
||||
# Build the project
|
||||
RUN cargo build --profile=profiling --bin appflowy_cloud
|
||||
RUN cargo build --profile=profiling --features="disable_collab_ac" --bin appflowy_cloud
|
||||
|
||||
|
||||
FROM debian:bookworm-slim AS runtime
|
||||
WORKDIR /app
|
||||
|
|
|
|||
|
|
@ -81,16 +81,24 @@ impl CollabAccessControl for CollabAccessControlImpl {
|
|||
}
|
||||
|
||||
async fn can_send_collab_update(&self, uid: &i64, oid: &str) -> Result<bool, AppError> {
|
||||
self
|
||||
.access_control
|
||||
.enforce(uid, &ObjectType::Collab(oid), Action::Write)
|
||||
.await
|
||||
if cfg!(feature = "disable_collab_ac") {
|
||||
Ok(true)
|
||||
} else {
|
||||
self
|
||||
.access_control
|
||||
.enforce(uid, &ObjectType::Collab(oid), Action::Write)
|
||||
.await
|
||||
}
|
||||
}
|
||||
|
||||
async fn can_receive_collab_update(&self, uid: &i64, oid: &str) -> Result<bool, AppError> {
|
||||
self
|
||||
.access_control
|
||||
.enforce(uid, &ObjectType::Collab(oid), Action::Read)
|
||||
.await
|
||||
if cfg!(feature = "disable_collab_ac") {
|
||||
Ok(true)
|
||||
} else {
|
||||
self
|
||||
.access_control
|
||||
.enforce(uid, &ObjectType::Collab(oid), Action::Read)
|
||||
.await
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue