Sha256: 63f5179539efb1967901e7b745e9fae6eb996afa9f4569163bd3bf8b7bbc012b

Contents?: true

Size: 1.14 KB

Versions: 8

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 = 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

8 entries across 8 versions & 1 rubygems

Version Path
hyrax-1.1.1 app/controllers/hyrax/admin/workflow_roles_controller.rb
hyrax-1.1.0 app/controllers/hyrax/admin/workflow_roles_controller.rb
hyrax-1.0.5 app/controllers/hyrax/admin/workflow_roles_controller.rb
hyrax-1.0.4 app/controllers/hyrax/admin/workflow_roles_controller.rb
hyrax-1.0.3 app/controllers/hyrax/admin/workflow_roles_controller.rb
hyrax-1.0.2 app/controllers/hyrax/admin/workflow_roles_controller.rb
hyrax-1.0.1 app/controllers/hyrax/admin/workflow_roles_controller.rb
hyrax-1.0.0.rc2 app/controllers/hyrax/admin/workflow_roles_controller.rb