Skip to content

Commit

Permalink
#113 allow admin to report time or any employee at any time
Browse files Browse the repository at this point in the history
  • Loading branch information
KlausRicharz committed May 18, 2022
1 parent 0610a85 commit 34e6ccb
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,8 @@ private void checkAuthorization(List<Timereport> timereports, AuthorizedUser aut
throw new AuthorizationException(TR_COMMITTED_TIME_REPORT_REQ_MANAGER);
}
if(TIMEREPORT_STATUS_OPEN.equals(t.getStatus()) &&
!Objects.equals(authorizedUser.getEmployeeId(), t.getEmployeecontract().getEmployee().getId())) {
!authorizedUser.isAdmin() &&
!Objects.equals(authorizedUser.getEmployeeId(), t.getEmployeecontract().getEmployee().getId())) {
throw new AuthorizationException(TR_OPEN_TIME_REPORT_REQ_EMPLOYEE);
}
});
Expand Down

0 comments on commit 34e6ccb

Please sign in to comment.