diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-31 20:41:05 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-31 20:41:05 +0200 |
| commit | 3b4e1423635fd9f33ae760312e438cc1e484662e (patch) | |
| tree | 0dd81aaf26ab5e4d7e178563f120b3e203c4dc0b /app/models/user.rb | |
| parent | 683526b38442a9873d83a542b5cba1d15efc14d5 (diff) | |
Show the gate before it refuses, and check the destination
nodes#show renders publish and trash as disabled_action spans with a hint
naming what an editor can still do, matching how locked_by_other already
reads. Editing and reverting stay live: drafting is free everywhere.
Diffstat (limited to 'app/models/user.rb')
| -rw-r--r-- | app/models/user.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index e8c3b9bb..bf0f40ee 100644 --- a/app/models/user.rb +++ b/app/models/user.rb | |||
| @@ -110,6 +110,12 @@ class User < ApplicationRecord | |||
| 110 | redaktion? | 110 | redaktion? |
| 111 | end | 111 | end |
| 112 | 112 | ||
| 113 | def may_change_live_at?(path) | ||
| 114 | return true if path.nil? | ||
| 115 | return true unless Node.restricted_path?(path) | ||
| 116 | redaktion? | ||
| 117 | end | ||
| 118 | |||
| 113 | def deactivate!(actor:) | 119 | def deactivate!(actor:) |
| 114 | return false if alumni? | 120 | return false if alumni? |
| 115 | transaction do | 121 | transaction do |
