Sha256: 544613fc4d05dbbd022c62eede173a4d4a94efa446b7dad598bc9412e27cfaae

Contents?: true

Size: 1.19 KB

Versions: 26

Compression:

Stored size: 1.19 KB

Contents

# frozen_string_literal: true
module Hyrax
  module Admin
    class WorkflowRolesController < ApplicationController
      before_action :require_permissions
      with_themed_layout 'dashboard'

      def index
        add_breadcrumb t(:'hyrax.controls.home'), root_path
        add_breadcrumb t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path
        add_breadcrumb t(:'hyrax.admin.workflow_roles.header'), hyrax.admin_workflow_roles_path
        @presenter = WorkflowRolesPresenter.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

26 entries across 26 versions & 1 rubygems

Version Path
hyrax-5.0.2 app/controllers/hyrax/admin/workflow_roles_controller.rb
hyrax-5.0.1 app/controllers/hyrax/admin/workflow_roles_controller.rb
hyrax-5.0.0 app/controllers/hyrax/admin/workflow_roles_controller.rb
hyrax-5.0.0.rc3 app/controllers/hyrax/admin/workflow_roles_controller.rb
hyrax-5.0.0.rc2 app/controllers/hyrax/admin/workflow_roles_controller.rb
hyrax-5.0.0.rc1 app/controllers/hyrax/admin/workflow_roles_controller.rb
hyrax-3.6.0 app/controllers/hyrax/admin/workflow_roles_controller.rb
hyrax-4.0.0 app/controllers/hyrax/admin/workflow_roles_controller.rb
hyrax-4.0.0.rc3 app/controllers/hyrax/admin/workflow_roles_controller.rb
hyrax-4.0.0.rc2 app/controllers/hyrax/admin/workflow_roles_controller.rb
hyrax-4.0.0.rc1 app/controllers/hyrax/admin/workflow_roles_controller.rb
hyrax-3.5.0 app/controllers/hyrax/admin/workflow_roles_controller.rb
hyrax-4.0.0.beta2 app/controllers/hyrax/admin/workflow_roles_controller.rb
hyrax-3.4.2 app/controllers/hyrax/admin/workflow_roles_controller.rb
hyrax-4.0.0.beta1 app/controllers/hyrax/admin/workflow_roles_controller.rb
hyrax-3.4.1 app/controllers/hyrax/admin/workflow_roles_controller.rb
hyrax-3.4.0 app/controllers/hyrax/admin/workflow_roles_controller.rb
hyrax-3.3.0 app/controllers/hyrax/admin/workflow_roles_controller.rb
hyrax-3.2.0 app/controllers/hyrax/admin/workflow_roles_controller.rb
hyrax-3.1.0 app/controllers/hyrax/admin/workflow_roles_controller.rb