ZCU-DATA/Prevent an admin from deleting their own account - #1443
Merged
milanmajchrak merged 2 commits intoAug 14, 2026
Conversation
Backport of the UFAL self-delete guard from dtq-dev (dspace-angular #1335, #1357, #1373) to this customer branch. The EPeople registry and the EPerson form now hide/disable the delete action for the currently authenticated user (with an explanatory tooltip), show a contextual warning in the confirmation modal when the target is a submitter and/or an administrator, and surface a friendly notification when the backend rejects a self-delete. Shared logic lives in the new EPersonDeleteGuardService so both call sites stay in sync. Refs dataquest-dev/dspace-customers#855
Rewrites the four Czech strings for the self-delete guard so they read
naturally rather than as literal translations, keeping the repository's
established Czech terminology (uživatel / správce / záznamy / smazat) and
active phrasing ("Jeho smazáním odeberete…" instead of the nominal
"Smazání tohoto uživatele odebere…"). Wording is identical across all
customer branches. Raised in review on PR #1447.
Refs dataquest-dev/dspace-customers#855
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.
Backport of the UFAL self-delete guard from
dtq-devontocustomer/zcu-data— #1335 (the feature), #1357 (friendly rejection notification) and #1373 (tooltip clipped by the table).What changes
warningLabelinput onConfirmationModalComponent.EPersonDeleteGuardServiceso the registry and the form stay in sync.Branch-specific notes
Cherry-picked, then adapted: 7.6.1 has no
dsBtnDisableddirective, so the disabled delete button uses the native[disabled]binding (specs assertnativeElement.disabledinstead ofaria-disabled).activeEPerson$was introduced on the form component, which this branch did not have.Verified locally (Node 22):
ng test --include='src/app/access-control/epeople-registry/**/*.spec.ts'and--include='src/app/shared/confirmation-modal/**/*.spec.ts'all green;eslinton the changed files reports 0 errors.Backend counterpart: dataquest-dev/DSpace#1398 — the two must ship together.
Refs dataquest-dev/dspace-customers#855
How this was verified
Manual — on a live instance (JCU 9.3 pair)
Throwaway stack: backend built from the paired branch
jcu/be-forbid-admin-self-delete(REST on :8091,own DB / Solr), frontend served from the branch under test, logged in as an administrator.
204and the account was gone (404) — the bug in issue #855, reproduced.container="body"part of #1373).Automated
Locally on this branch (Node 22):
ng test --include='src/app/access-control/epeople-registry/**/*.spec.ts'→ 55 tests, 0 failures;--include='src/app/shared/confirmation-modal/**/*.spec.ts'→ 13 tests, 0 failures;eslinton the changed files → 0 errors.The CI
testsjob runs lint plus the full unit suite on this PR.The live run was on the JCU 9.3 pair. The three 7.6.1 branches —
zcu-pub,zcu-data,sav— carry byte-identical source files for this change (all five of them; only the i18n files differ between the three), so this verification applies equally to all three. The 7.6.1 UI itself was not exercised in a browser; its behaviour is covered by the unit tests below, which assert the same DOM outcome (button disabled, modal not opened, notification shown).Live UI screenshots
Captured live in a browser (7.6.1 FE against a genuine DSpace 7.6.5 backend): logged in as an administrator, opened
Access Control → EPeople. The admin's own row is the first one.
Before — the own row's Delete button is enabled/clickable (the bug).

After — the own row's Delete button is disabled and shows the tooltip "You cannot delete your own EPerson account."; other rows stay enabled.
