-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #974 from projecthydra/ext_perm
Making the permissions controller use a behavior so we can extend the behavior
- Loading branch information
Showing
2 changed files
with
24 additions
and
16 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
app/controllers/concerns/curation_concerns/permissions_controller_behavior.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
17
app/controllers/curation_concerns/permissions_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |