From 529f81b28ed77c62acaa63fad957e751798f2440 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Fri, 31 Jul 2026 22:36:17 +0200 Subject: Warn before the gate refuses, and check restore destinations nodes#new marks the kinds that place under /updates, derived from each kind's own path_prefix. The three parent pickers mark candidates the current user cannot publish into; menu_search returns needs_redaktion per result, computed per user rather than as a bare restricted flag, and the menu-item picker opts out. restore_from_trash! checks its destination: the restore is the move, applied rather than staged, so no later publish would have caught it. The node returns as a draft either way. --- app/models/node.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'app/models/node.rb') diff --git a/app/models/node.rb b/app/models/node.rb index 188b6c17..d6fe32ff 100644 --- a/app/models/node.rb +++ b/app/models/node.rb @@ -375,6 +375,9 @@ class Node < ApplicationRecord raise ActiveRecord::RecordInvalid.new(self) end + guard_live_change!(current_user, + :target_path => [new_parent.unique_name.presence, slug].compact.join("/")) + ActiveRecord::Base.transaction do path_before = unique_name move_to_child_of(new_parent) -- cgit v1.3