Class: Decidim::ActionDelegator::Admin::PermissionsController
- Inherits:
-
ApplicationController
- Object
- Decidim::Admin::ApplicationController
- ApplicationController
- Decidim::ActionDelegator::Admin::PermissionsController
- Defined in:
- app/controllers/decidim/action_delegator/admin/permissions_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/decidim/action_delegator/admin/permissions_controller.rb', line 7 def create :update, :setting return redirect_to decidim_admin_action_delegator.settings_path unless setting&.consultation FixResourcePermissions.call(setting.consultation.questions) do on(:ok) do notice = I18n.t("permissions.update.success", scope: "decidim.action_delegator.admin") redirect_to decidim_admin_action_delegator.settings_path, notice: notice end on(:invalid) do |_error| flash.now[:error] = I18n.t("permissions.update.error", scope: "decidim.action_delegator.admin") render :new end end end |
#sync ⇒ Object
24 25 26 27 28 29 30 |
# File 'app/controllers/decidim/action_delegator/admin/permissions_controller.rb', line 24 def sync :update, :setting SyncParticipantsJob.perform_later(setting) notice = I18n.t("permissions.sync.started", scope: "decidim.action_delegator.admin") redirect_to decidim_admin_action_delegator.settings_path, notice: notice end |