Class: Decidim::Components::BaseController
Overview
Controller from which all component engines inherit from. It’s in charge of setting the appropiate layout, including necessary helpers, and overall fooling the engine into thinking it’s isolated.
Instance Method Summary
collapse
register_permissions
#check_user_block_status, #check_user_not_blocked
#snippets
#disable_http_caching
#skip_store_location?, #store_current_location
enhance_controller, extended, included
Instance Method Details
#current_component ⇒ Object
42
43
44
|
# File 'app/controllers/decidim/components/base_controller.rb', line 42
def current_component
request.env["decidim.current_component"]
end
|
#current_manifest ⇒ Object
46
47
48
|
# File 'app/controllers/decidim/components/base_controller.rb', line 46
def current_manifest
@current_manifest ||= current_component.manifest
end
|
#current_participatory_space ⇒ Object
38
39
40
|
# File 'app/controllers/decidim/components/base_controller.rb', line 38
def current_participatory_space
request.env["decidim.current_participatory_space"]
end
|
#permission_class_chain ⇒ Object
58
59
60
61
62
63
64
65
|
# File 'app/controllers/decidim/components/base_controller.rb', line 58
def permission_class_chain
[
current_component.manifest.permissions_class,
current_participatory_space.manifest.permissions_class,
Decidim::Admin::Permissions,
Decidim::Permissions
]
end
|
#permission_scope ⇒ Object
54
55
56
|
# File 'app/controllers/decidim/components/base_controller.rb', line 54
def permission_scope
:public
end
|
#redirect_unless_feature_private ⇒ Object
67
68
69
|
# File 'app/controllers/decidim/components/base_controller.rb', line 67
def redirect_unless_feature_private
raise ActionController::RoutingError, "Not Found" unless current_user_can_visit_space?
end
|
#share_token ⇒ Object
50
51
52
|
# File 'app/controllers/decidim/components/base_controller.rb', line 50
def share_token
params[:share_token]
end
|