Sha256: baff589c7ec54b89c690e4209ae760a9394338e9f5655182d47d2407754f1d8e

Contents?: true

Size: 949 Bytes

Versions: 13

Compression:

Stored size: 949 Bytes

Contents

module CurationConcerns
  module Admin
    class WorkflowRolesController < ApplicationController
      include AdminPage
      before_action :require_permissions

      def index
        @presenter = WorkflowRolePresenter.new
      end

      def destroy
        responsibility = Sipity::WorkflowResponsibility.find(params[:id])
        authorize! :destroy, responsibility
        responsibility.destroy
        redirect_to admin_workflow_roles_path
      end

      def create
        authorize! :create, Sipity::WorkflowResponsibility
        form = Forms::WorkflowResponsibilityForm.new(params[:sipity_workflow_responsibility])
        begin
          form.save!
        rescue ActiveRecord::RecordNotUnique
          logger.info "Not unique *****\n\n\n"
        end
        redirect_to admin_workflow_roles_path
      end

      private

        def require_permissions
          authorize! :read, :admin_dashboard
        end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
curation_concerns-1.7.8 app/controllers/curation_concerns/admin/workflow_roles_controller.rb
curation_concerns-1.7.7 app/controllers/curation_concerns/admin/workflow_roles_controller.rb
curation_concerns-2.0.0 app/controllers/curation_concerns/admin/workflow_roles_controller.rb
curation_concerns-2.0.0.rc2 app/controllers/curation_concerns/admin/workflow_roles_controller.rb
curation_concerns-1.7.6 app/controllers/curation_concerns/admin/workflow_roles_controller.rb
curation_concerns-1.7.5 app/controllers/curation_concerns/admin/workflow_roles_controller.rb
curation_concerns-1.7.4 app/controllers/curation_concerns/admin/workflow_roles_controller.rb
curation_concerns-1.7.3 app/controllers/curation_concerns/admin/workflow_roles_controller.rb
curation_concerns-1.7.2 app/controllers/curation_concerns/admin/workflow_roles_controller.rb
curation_concerns-2.0.0.rc1 app/controllers/curation_concerns/admin/workflow_roles_controller.rb
curation_concerns-1.7.1 app/controllers/curation_concerns/admin/workflow_roles_controller.rb
curation_concerns-1.7.0 app/controllers/curation_concerns/admin/workflow_roles_controller.rb
curation_concerns-1.7.0.beta1 app/controllers/curation_concerns/admin/workflow_roles_controller.rb