Sha256: 086cd54159bedaea620a0e83d6a3a4d2181aa41f8b1779d39706db2294cafe5e

Contents?: true

Size: 1.14 KB

Versions: 2

Compression:

Stored size: 1.14 KB

Contents

module Hyrax
  module Admin
    class WorkflowRolesController < ApplicationController
      before_action :require_permissions
      layout 'admin'

      def index
        add_breadcrumb t(:'hyrax.controls.home'), root_path
        add_breadcrumb t(:'hyrax.toolbar.admin.menu'), hyrax.admin_path
        add_breadcrumb t(:'hyrax.admin.workflow_roles.header'), hyrax.admin_workflow_roles_path
        @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

2 entries across 2 versions & 2 rubygems

Version Path
hyrax-1.0.0.rc1 app/controllers/hyrax/admin/workflow_roles_controller.rb
test_hyrax-0.0.1.alpha app/controllers/hyrax/admin/workflow_roles_controller.rb