]> uap-core.de Git - note.git/commitdiff
add read_only field to collection model main
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Sat, 15 Aug 2026 08:23:49 +0000 (10:23 +0200)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Sat, 15 Aug 2026 08:23:49 +0000 (10:23 +0200)
application/note/src/notebook.rs
entity/src/collection.rs
migration/src/m20260502_184134_create_settings.rs

index a091dfa12eefe056951ff80316b10885c718fbab..9f0df0fd33175f1c2a008dd00a8092d3e00251fc 100644 (file)
@@ -519,7 +519,8 @@ impl NotebookItem {
 
     pub fn load_notebook(&mut self, backend: &BackendHandle) -> UiDoc<Notebook> {
         // 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());
index f89817888f1337e5c11c1252c36b38c2ee6cb82f..b85d729c0684d71be7aedb30e8411268c1f84df7 100644 (file)
@@ -45,7 +45,8 @@ pub struct Model {
     pub parent: String,
     pub icon: Option<String>,
     pub kind: CollectionType,
-    pub storage: LocalStorageSetting
+    pub storage: LocalStorageSetting,
+    pub read_only: bool,
 }
 
 impl Model {
index 7517da9442eaec01ba659f80ec2904f81ceb0db5..c91f191fabbf96bc5bbe60e3b1370ad26b555c2a 100644 (file)
@@ -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")