Class: Decidim::Elections::Admin::Permissions
- Inherits:
-
DefaultPermissions
- Object
- DefaultPermissions
- Decidim::Elections::Admin::Permissions
- Defined in:
- decidim-elections/app/permissions/decidim/elections/admin/permissions.rb
Instance Method Summary collapse
Methods inherited from DefaultPermissions
Constructor Details
This class inherits a constructor from Decidim::DefaultPermissions
Instance Method Details
#permissions ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'decidim-elections/app/permissions/decidim/elections/admin/permissions.rb', line 7 def return if .scope != :admin case .subject when :question, :answer case .action when :create, :update, :delete, :import_proposals allow_if_not_blocked when :select allow_if_results end when :steps case .action when :read, :update allow! end when :election case .action when :create, :read allow! when :delete, :update, :unpublish, :publish allow_if_not_blocked end when :trustees case .action when :manage toggle_allow(user.admin?) end when :trustee_participatory_space case .action when :create, :update allow! when :delete end when :questionnaire case .action when :export_answers .allow! when :update toggle_allow(feedback_form.present?) end when :questionnaire_answers case .action when :index, :show, :export_response .allow! end end end |