Module: Decidim::ActionAuthorizationHelper
- Included in:
- ViewModel
- Defined in:
- app/helpers/decidim/action_authorization_helper.rb
Instance Method Summary collapse
-
#action_authorized_button_to(action, *arguments, &block) ⇒ Object
Public: Emulates a ‘button_to` but conditionally renders a popup modal blocking the action in case the user is not allowed to perform it.
-
#action_authorized_link_to(action, *arguments, &block) ⇒ Object
Public: Emulates a ‘link_to` but conditionally renders a popup modal blocking the action in case the user is not allowed to perform it.
-
#logged_button_to(*arguments, &block) ⇒ Object
Public: Emulates a ‘button_to` but conditionally renders a popup modal blocking the action in case the user is not logged id.
-
#logged_link_to(*arguments, &block) ⇒ Object
Public: Emulates a ‘link_to` but conditionally renders a popup modal blocking the action in case the user is not logged id.
Instance Method Details
#action_authorized_button_to(action, *arguments, &block) ⇒ Object
Public: Emulates a ‘button_to` but conditionally renders a popup modal blocking the action in case the user is not allowed to perform it.
action - The name of the action to authorize against. *arguments - A regular set of arguments that would be provided to
`button_to`.
Returns a String with the button.
25 26 27 |
# File 'app/helpers/decidim/action_authorization_helper.rb', line 25 def (action, *arguments, &block) (:button, action, arguments, block) end |
#action_authorized_link_to(action, *arguments, &block) ⇒ Object
Public: Emulates a ‘link_to` but conditionally renders a popup modal blocking the action in case the user is not allowed to perform it.
action - The name of the action to authorize against. *arguments - A regular set of arguments that would be provided to
`link_to`.
Returns a String with the link.
13 14 15 |
# File 'app/helpers/decidim/action_authorization_helper.rb', line 13 def (action, *arguments, &block) (:link, action, arguments, block) end |
#logged_button_to(*arguments, &block) ⇒ Object
Public: Emulates a ‘button_to` but conditionally renders a popup modal blocking the action in case the user is not logged id.
*arguments - A regular set of arguments that would be provided to
`button_to`.
Returns a String with the button.
47 48 49 |
# File 'app/helpers/decidim/action_authorization_helper.rb', line 47 def (*arguments, &block) (:button, nil, arguments, block) end |
#logged_link_to(*arguments, &block) ⇒ Object
Public: Emulates a ‘link_to` but conditionally renders a popup modal blocking the action in case the user is not logged id.
*arguments - A regular set of arguments that would be provided to
`link_to`.
Returns a String with the link.
36 37 38 |
# File 'app/helpers/decidim/action_authorization_helper.rb', line 36 def logged_link_to(*arguments, &block) (:link, nil, arguments, block) end |