Skip to content

Commit d1d2b59

Browse files
authored
Merge pull request #3677 from OregonDigital/update/moreUpdateToVieweronPrivacy
Add in a role-based on cache for UV
2 parents 71b0f4d + 2a3985a commit d1d2b59

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

app/controllers/concerns/oregon_digital/iiif_manifest_controller_behavior.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ def jp2_work_presenter
8787
# @return [String]
8888
def manifest_cache_key
8989
solrdoc = SolrDocument.find(params['id'])
90-
"#{KEY_PREFIX}_#{solrdoc.id}/#{version_for(solrdoc)}"
90+
91+
# Add in a prefix to determine which cache to render
92+
current_role = current_ability.can?(:edit, solrdoc) ? 'editor' : 'public'
93+
94+
"#{KEY_PREFIX}_#{solrdoc.id}/#{version_for(solrdoc)}/#{current_role}"
9195
end
9296

9397
##

0 commit comments

Comments
 (0)