Skip to content

Commit

Permalink
[CST-12108] fixed withdrawn & reinstate correction types
Browse files Browse the repository at this point in the history
  • Loading branch information
Micheleboychuk committed Nov 24, 2023
1 parent 89b7c22 commit 919f1af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public class ReinstateCorrectionType implements CorrectionType, InitializingBean
@Override
public boolean isAllowed(Context context, Item targetItem) throws SQLException, AuthorizeException {
authorizeService.authorizeAction(context, targetItem, Constants.READ);
return targetItem.isWithdrawn();
long tot = qaEventService.countSourcesByTarget(context, targetItem.getID());
return tot == 0 && targetItem.isWithdrawn();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public class WithdrawnCorrectionType implements CorrectionType, InitializingBean
@Override
public boolean isAllowed(Context context, Item targetItem) throws AuthorizeException, SQLException {
authorizeService.authorizeAction(context, targetItem, READ);
return targetItem.isArchived() && !targetItem.isWithdrawn();
long tot = qaEventService.countSourcesByTarget(context, targetItem.getID());
return tot == 0 && targetItem.isArchived() && !targetItem.isWithdrawn();
}

@Override
Expand Down

0 comments on commit 919f1af

Please sign in to comment.