diff --git a/backend/src/main/java/ch/puzzle/okr/service/authorization/UserAuthorizationService.java b/backend/src/main/java/ch/puzzle/okr/service/authorization/UserAuthorizationService.java index c95ab16253..772a7629cd 100644 --- a/backend/src/main/java/ch/puzzle/okr/service/authorization/UserAuthorizationService.java +++ b/backend/src/main/java/ch/puzzle/okr/service/authorization/UserAuthorizationService.java @@ -66,23 +66,22 @@ public List createUsers(List userList) { } public boolean isUserMemberOfTeams(long id) { - // TODO check Role List userTeamList = userBusinessService.getUserById(id).getUserTeamList(); return userTeamList != null && !userTeamList.isEmpty(); } public boolean isUserOwnerOfKeyResults(long id) { - // TODO check Role return keyResultBusinessService.isUserOwnerOfKeyResults(id); } public void deleteEntityById(long id) { - // TODO check Role + AuthorizationService.checkRoleWriteAndReadAll(authorizationService.updateOrAddAuthorizationUser(), + OkrResponseStatusException.of(ErrorKey.NOT_AUTHORIZED_TO_DELETE, USER)); + userBusinessService.deleteEntityById(id); } public UserOkrDataDto getUserOkrData(long id) { - // TODO check Role List keyResultsOwnedByUser = keyResultBusinessService.getKeyResultsOwnedByUser(id); return new UserOkrDataMapper().toDto(keyResultsOwnedByUser); }