From: Olaf Wintermann Date: Sat, 15 Aug 2026 08:23:49 +0000 (+0200) Subject: add read_only field to collection model X-Git-Url: https://uap-core.de/gitweb/?a=commitdiff_plain;h=HEAD;p=note.git add read_only field to collection model --- diff --git a/application/note/src/notebook.rs b/application/note/src/notebook.rs index a091dfa..9f0df0f 100644 --- a/application/note/src/notebook.rs +++ b/application/note/src/notebook.rs @@ -519,7 +519,8 @@ impl NotebookItem { pub fn load_notebook(&mut self, backend: &BackendHandle) -> UiDoc { // Create Notebook UI model - let notebook = Notebook::new(self.data.collection_id, backend); + let mut notebook = Notebook::new(self.data.collection_id, backend); + notebook.read_only = self.data.read_only; let doc = notebook.into_doc(); self.model = Some(doc.clone()); diff --git a/entity/src/collection.rs b/entity/src/collection.rs index f898178..b85d729 100644 --- a/entity/src/collection.rs +++ b/entity/src/collection.rs @@ -45,7 +45,8 @@ pub struct Model { pub parent: String, pub icon: Option, pub kind: CollectionType, - pub storage: LocalStorageSetting + pub storage: LocalStorageSetting, + pub read_only: bool, } impl Model { diff --git a/migration/src/m20260502_184134_create_settings.rs b/migration/src/m20260502_184134_create_settings.rs index 7517da9..c91f191 100644 --- a/migration/src/m20260502_184134_create_settings.rs +++ b/migration/src/m20260502_184134_create_settings.rs @@ -46,6 +46,7 @@ impl MigrationTrait for Migration { .col(string_null("icon")) .col(integer("kind")) .col(integer("storage").default(0)) + .col(boolean("read_only").default(false)) .foreign_key( ForeignKey::create() .name("fk-collection-profile")