Module: Strongbolt::BoltedController::InstanceMethods
- Defined in:
- lib/strongbolt/bolted_controller.rb
Instance Method Summary collapse
- #can?(*args) ⇒ Boolean
- #cannot?(*args) ⇒ Boolean
-
#render(*args) ⇒ Object
We’re aliasing render so we can trigger the without auth.
-
#render_without_authorization? ⇒ Boolean
Checks if the current action needs verification.
Instance Method Details
#can?(*args) ⇒ Boolean
138 139 140 |
# File 'lib/strongbolt/bolted_controller.rb', line 138 def can?(*args) Strongbolt.current_user.can?(*args) end |
#cannot?(*args) ⇒ Boolean
142 143 144 |
# File 'lib/strongbolt/bolted_controller.rb', line 142 def cannot?(*args) Strongbolt.current_user.cannot?(*args) end |
#render(*args) ⇒ Object
We’re aliasing render so we can trigger the without auth
DOESN’T WORK WHEN DEFINED HERE?
159 160 161 162 163 164 165 |
# File 'lib/strongbolt/bolted_controller.rb', line 159 def render(*args) if Strongbolt. { _render(*args) } else _render(*args) end end |
#render_without_authorization? ⇒ Boolean
Checks if the current action needs verification
149 150 151 152 |
# File 'lib/strongbolt/bolted_controller.rb', line 149 def self.class..present? && self.class..include?(params[:action].to_sym) end |