Skip to content

Commit

Permalink
Merge pull request #974 from projecthydra/ext_perm
Browse files Browse the repository at this point in the history
Making the permissions controller use a behavior so we can extend the behavior
  • Loading branch information
escowles committed Sep 12, 2016
2 parents 72f2535 + 469a31c commit 5ab686c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module CurationConcerns
module PermissionsControllerBehavior
extend ActiveSupport::Concern

included do
include CurationConcerns::CurationConcernController

def confirm
end

def copy
authorize! :edit, curation_concern
VisibilityCopyJob.perform_later(curation_concern)
flash_message = 'Updating file permissions. This may take a few minutes. You may want to refresh your browser or return to this record later to see the updated file permissions.'
redirect_to [main_app, curation_concern], notice: flash_message
end

def curation_concern
@curation_concern ||= ActiveFedora::Base.find(params[:id])
end
end
end
end
17 changes: 1 addition & 16 deletions app/controllers/curation_concerns/permissions_controller.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
class CurationConcerns::PermissionsController < ApplicationController
include CurationConcerns::CurationConcernController
with_themed_layout '1_column'

def confirm
end

def copy
authorize! :edit, curation_concern
VisibilityCopyJob.perform_later(curation_concern)
flash_message = 'Updating file permissions. This may take a few minutes. You may want to refresh your browser or return to this record later to see the updated file permissions.'
redirect_to [main_app, curation_concern], notice: flash_message
end

def curation_concern
@curation_concern ||= ActiveFedora::Base.find(params[:id])
end
include CurationConcerns::PermissionsControllerBehavior
end

0 comments on commit 5ab686c

Please sign in to comment.