Class: Decidim::Surveys::SurveyType

Inherits:
Api::Types::BaseObject show all
Defined in:
decidim-surveys/lib/decidim/api/survey_type.rb

Class Method Summary collapse

Methods inherited from Api::Types::BaseObject

allowed_to?, determine_subject_name, local_context, permission_chain

Class Method Details

.authorized?(object, context) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
16
17
18
19
20
# File 'decidim-surveys/lib/decidim/api/survey_type.rb', line 13

def self.authorized?(object, context)
  context[:survey] = object
  context[:current_settings] = object.component.current_settings

  super
rescue Decidim::PermissionAction::PermissionNotSetError
  false
end