Make advanced attachment element visibility configurable (checksum admin-only by default)#5823
Open
bram-atmire wants to merge 1 commit into
Open
Make advanced attachment element visibility configurable (checksum admin-only by default)#5823bram-atmire wants to merge 1 commit into
bram-atmire wants to merge 1 commit into
Conversation
…min-only by default) Add an optional 'visibility' property (public | admin) to each advancedAttachmentRendering metadata element. Elements marked 'admin' are only rendered for site administrators; omitting an element hides it from everyone. The checksum attribute now defaults to admin-only so anonymous and regular users no longer see it on the item page. Refs DSpace#5822
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
References
Fixes #5822
Description
Makes the visibility of advanced attachment elements (such as the bitstream checksum) configurable on the item page, and defaults the checksum to admin-only so it is no longer shown to anonymous and regular users.
Instructions for Reviewers
This only affects the advanced attachment rendering used on the item page when
layout.showDownloadLinkAsAttachment: true(theds-bitstream-attachmentcards), which is the only place the checksum is rendered.List of changes in this PR:
visibilityproperty to eachlayout.advancedAttachmentRendering.metadataelement, with two values:public(the default when omitted) - visible to everyone, including anonymous usersadmin- visible only to site administrators (gated onFeatureID.AdministratorOf)BitstreamAttachmentComponentnow filters the configured elements by the current user's admin status before rendering (visibleMetadataConfig$).checksumelement tovisibility: adminindefault-app-config.tsandconfig.example.yml(and the test environment), so out of the box the checksum is admin-only.How to test:
layout.showDownloadLinkAsAttachment: truein yourconfig.*.yml.checksumelement'svisibilitytopublic(visible to all) or remove it (hidden from all) to confirm the three states.Checklist
mainbranch of code.config.example.yml).