-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't allow download of archived files
- Loading branch information
Showing
3 changed files
with
23 additions
and
3 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
|
@@ -67,7 +67,9 @@ | |
%tr | ||
%td.empty | ||
%td.empty | ||
- if can? :download, @essence | ||
- if admin_user_signed_in? | ||
= link_to 'Download', download_collection_item_essence_path(@collection, @item, @essence), download: true | ||
- elsif [email protected]_archived? && can?(:download, @essence) | ||
= link_to 'Download', download_collection_item_essence_path(@collection, @item, @essence), download: true | ||
- else | ||
%p No access rights to download essence. | ||
|
@@ -79,7 +81,7 @@ | |
%fieldset | ||
%legend Preview | ||
#media_item | ||
- if can? :display, @essence | ||
- if [email protected]_archived? && can?(:display, @essence) | ||
- case @essence.mimetype | ||
- when /^image\/(jpeg|png|gif|tiff|bmp)/ | ||
= image_tag display_collection_item_essence_path(@collection, @item, @essence) | ||
|