Skip to content

Commit cd698ca

Browse files
committed
Add missing @PreAuthorize to ProcessRestRepository#delete
DELETE /api/system/processes/{id} had no method-level authorization check, unlike its siblings (findOne, findAll, findByCurrentUser). The only check lived inside ProcessServiceImpl#delete's per-bitstream loop, so a process with zero bitstreams (e.g. status SCHEDULED) skipped the loop entirely and bypassed authorization, letting an anonymous DELETE remove any process record. Adds hasPermission(#integer, 'PROCESS', 'DELETE'), matching findOne. Reuses the existing ProcessRestPermissionEvaluatorPlugin (owner-or- admin check, independent of READ/WRITE/DELETE) - no new plugin needed. Originated from security audit (2026_07_20_dq)
1 parent 00501a2 commit cd698ca

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ProcessRestRepository.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ public BitstreamRest getProcessBitstreamByType(Integer processId, String type)
164164
}
165165

166166
@Override
167+
@PreAuthorize("hasPermission(#integer, 'PROCESS', 'DELETE')")
167168
protected void delete(Context context, Integer integer)
168169
throws AuthorizeException, RepositoryMethodNotImplementedException {
169170
try {

0 commit comments

Comments
 (0)