Class: Actions::Middleware::KeepCurrentUser
- Inherits:
-
Dynflow::Middleware
- Object
- Dynflow::Middleware
- Actions::Middleware::KeepCurrentUser
- Defined in:
- app/lib/actions/middleware/keep_current_user.rb
Instance Method Summary collapse
- #delay(*args) ⇒ Object
- #finalize ⇒ Object
- #finalize_phase(execution_plan, *args) ⇒ Object
-
#hook(*args) ⇒ Object
Run all execution plan lifecycle hooks as the original user.
- #plan(*args) ⇒ Object
- #run(*args) ⇒ Object
Instance Method Details
#delay(*args) ⇒ Object
4 5 6 |
# File 'app/lib/actions/middleware/keep_current_user.rb', line 4 def delay(*args) pass(*args).tap { store_current_user } end |
#finalize ⇒ Object
18 19 20 |
# File 'app/lib/actions/middleware/keep_current_user.rb', line 18 def finalize restore_current_user { pass } end |
#finalize_phase(execution_plan, *args) ⇒ Object
22 23 24 |
# File 'app/lib/actions/middleware/keep_current_user.rb', line 22 def finalize_phase(execution_plan, *args) restore_current_user(execution_plan.entry_action) { pass(execution_plan, *args) } end |
#hook(*args) ⇒ Object
Run all execution plan lifecycle hooks as the original user
27 28 29 |
# File 'app/lib/actions/middleware/keep_current_user.rb', line 27 def hook(*args) restore_current_user { pass(*args) } end |
#plan(*args) ⇒ Object
8 9 10 11 12 |
# File 'app/lib/actions/middleware/keep_current_user.rb', line 8 def plan(*args) with_current_user do pass(*args).tap { store_current_user } end end |
#run(*args) ⇒ Object
14 15 16 |
# File 'app/lib/actions/middleware/keep_current_user.rb', line 14 def run(*args) restore_current_user { pass(*args) } end |