JCU/feat(access-status): show the embargo label on files and access statuses in result lists - #1439
Merged
milanmajchrak merged 2 commits intoAug 7, 2026
Conversation
The per-file access-status label ("Embargo until <date>") is gated behind
item.bitstream.showAccessStatuses, which defaults to false in
default-app-config.ts. JCU's config.yml never set it, so an anonymous visitor
looking at an embargoed file only got the lock icon and no reason for it.
The backend already serves the data (/server/api/core/bitstreams/<uuid>/accessStatus,
BitstreamAccessStatusLinkRepository) and the frontend fails closed if it does not,
so enabling the flag is enough.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
item.showAccessStatuses is the sibling flag of the one enabled in the previous commit, and it is off for the same reason - it was never set. It puts an access-status badge (Open Access / Embargo / Restricted / Metadata only) next to each item in search, browse and the recent-items list, so an embargo is visible before you open the record rather than only inside it. Same as customer/mendelu, which enables both. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Enables the existing access-status UI features for the JCU deployment by turning on the two configuration flags that gate rendering of access status labels/badges (item-level in lists and bitstream-level in the Item View).
Changes:
- Enable per-item access status badges in search/browse/recent-items via
item.showAccessStatuses: true. - Enable per-bitstream access status labels in the Item View via
item.bitstream.showAccessStatuses: true. - Add inline config comments documenting where each flag is surfaced and the related REST endpoints.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
An anonymous visitor looking at an embargoed file in the Item View gets a lock icon and no reason
for it — no date, no label. And the search and browse lists say nothing about access at all. Both
labels exist in DSpace and the backend already serves the data; the frontend just never turned them
on for JCU.
Two flags, both
falseinsrc/config/default-app-config.ts, neither of them set inconfig/config.yml:item.bitstream.showAccessStatusesEmbargo until <date>item.showAccessStatusesOpen Access,Embargo,Restricted,Metadata onlyWhy nothing was shown
AccessStatusBadgeComponentreturns before rendering anything unless the flag is on:/assets/config.jsonon the JCU stack served:Nothing else was missing. The backend endpoints
(
/server/api/core/{items,bitstreams}/<uuid>/accessStatus,ItemAccessStatusLinkRepository/BitstreamAccessStatusLinkRepository) answer correctly, and the frontend fails closed if they donot — so this is a config change only.
Verified
Local Docker DSpace 9.3 with the JCU configuration. Test item with two files in
ORIGINAL:verejny-dokument.pdf(inherited anonymous READ) andembargovana-priloha.pdf(anonymous READ withstartDate = 2030-01-01). REST agrees the file is embargoed for an anonymous caller, before andafter this PR:
Item View, anonymous:
verejny-dokument.pdf (74 B)/ 🔒embargovana-priloha.pdf (74 B)verejny-dokument.pdf (74 B)/Embargo until 2030-01-01🔒embargovana-priloha.pdf (74 B)Search / browse / home, anonymous —
.access-status-list-element-badgeon each page goes from0 → 4 (one per item), reading
ItemMetadata onlyfor the records with no files andItemEmbargofor the test item once its primary bitstream is the embargoed one. Switch theprimary bitstream back to the open file and the same item reads
Open Access, which is thedocumented behaviour — the item-level status comes from the primary bitstream, or the first one in
ORIGINALif none is primary.In both cases the visible text is preceded by an
sr-onlyAccess status:, so screen readers getAccess status: Embargo until 2030-01-01rather than a bare date.Cost: no extra requests
Both call sites already ask for the data whether or not a badge is rendered —
FileSectionComponent.findAllByItemAndBundleName(..., followLink('accessStatus'))andSearchComponent, which appendsfollowLink('accessStatus')when the flag is on. Counted on thewire, the status arrives embedded in requests that were being made anyway, and there are zero
standalone
/accessStatuscalls on either page:Two things worth knowing before this hits production data
A file that is merely restricted still shows no label in the Item View. The component renders one
only when there is a date:
So
restricted— a READ policy with no start date, or no anonymous READ at all — produces the lockicon and nothing else. Only a genuine embargo, a future policy start date, produces the label. (The
item-level badge in the result lists does have a
Restrictedstate; the per-file one does not.)Every record without files gets a
Metadata onlybadge in the result lists. That is accurate,but on a repository where metadata-only records are common it is a lot of new badges — worth a look
at the real data before merging.
Related
dataquest-dev/DSpace#1394— backend companion. Withaccess.status.for-user.bitstream = currentindspace.cfg, the status is computed for the current user, so an administrator, who can read thefile, is told
open.accessand sees no label. That PR switches it toanonymousso the labeldescribes the file rather than the viewer.
Same flags as ZCU (#1403 / #1404, bitstream only) and MENDELU (#1243, both).
How to see it
/search, logged out.<host>/assets/config.jsonmust show both flagstrue— the file is read at UI startup, sorestart the UI after deploying, and check that no mounted
config.prod.ymlorDSPACE_ITEM_SHOWACCESSSTATUSES/DSPACE_ITEM_BITSTREAM_SHOWACCESSSTATUSESenv var overridesit.
🤖 Generated with Claude Code