Skip to content

Commit

Permalink
Merged in task/dspace-cris-2023_02_x/DSC-1940 (pull request DSpace#2807)
Browse files Browse the repository at this point in the history
[DSC-1940] Adapt permission for audits

Approved-by: Andrea Barbasso
  • Loading branch information
FrancescoMolinaro authored and Andrea Barbasso committed Nov 13, 2024
2 parents 45392fb + beb8972 commit 4c666a3
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,14 @@ public AuditEventRest findOne(Context context, UUID id) {
}


@PreAuthorize("hasAuthority('ADMIN')")
@PreAuthorize("hasPermission(#commUuid, 'COMMUNITY', 'WRITE') " +
"or hasPermission(#collUuid, 'COLLECTION', 'WRITE') " +
"or hasAuthority('ADMIN')")
@SearchRestMethod(name = "findByObject")
public Page<AuditEventRest> findByObject(@Parameter(value = "object", required = true) UUID uuid,
Pageable pageable) throws AuthorizeException, SQLException {
public Page<AuditEventRest> findByObject(
@Parameter(value = "object", required = true) UUID uuid, Pageable pageable,
@Parameter(value = "commUuid") UUID commUuid, @Parameter(value = "collUuid") UUID collUuid
) throws AuthorizeException, SQLException {
returnNotFoundIfDisabled();
Context context = obtainContext();
Sort sort = pageable.getSort();
Expand Down

0 comments on commit 4c666a3

Please sign in to comment.