Viet.LeQ2 1 рік тому
джерело
коміт
0296550dde
2 змінених файлів з 5 додано та 5 видалено
  1. +3
    -3
      src/main/java/vn/azteam/tpf/service/impl/TBCodeDetailsImpl.java
  2. +2
    -2
      src/main/java/vn/azteam/tpf/web/rest/TBCodeResource.java

+ 3
- 3
src/main/java/vn/azteam/tpf/service/impl/TBCodeDetailsImpl.java Переглянути файл

@@ -133,9 +133,9 @@ public class TBCodeDetailsImpl implements TBCodeDetailsService {
Boolean isRequestedFromWeb) {
// Optional<TBCropDTO> tBCropDTO = tBCropService.findOne(id);

// if (!userRoleUtil.currentUserHasPermissionByCropId(tBCropDTO.getId())) {
// throw new BadRequestAlertException("1018", ENTITY_NAME, "1018");
// }
if (!userRoleUtil.currentUserHasPermissionByCropId(tBCropDTO.getId())) {
throw new BadRequestAlertException("1018", ENTITY_NAME, "1018");
}
Optional<UserDTO> currentUser = userService.getCurrentUserDTO();
TBCodeDetailsAndActivityDTO tbCodeDetailsAndActivityDTO = new TBCodeDetailsAndActivityDTO();
tbCodeDetailsAndActivityDTO.setTbCropDTO(tBCropDTO);

+ 2
- 2
src/main/java/vn/azteam/tpf/web/rest/TBCodeResource.java Переглянути файл

@@ -107,8 +107,8 @@ public class TBCodeResource {

//Authorize get list crop by customer of current user
List<TBCodeDTO> result = page.getContent().stream()
// .filter(item -> userRoleUtil.currentUserHasPermissionByCustomerId(item.getTbCrop().getId())
// && userRoleUtil.currentUserHasPermissionByCropId(item.getTbCrop().getId()))
.filter(item -> userRoleUtil.currentUserHasPermissionByCustomerId(item.getTbCrop().getId())
&& userRoleUtil.currentUserHasPermissionByCropId(item.getTbCrop().getId()))
.sorted(Comparator.comparing(
TBCodeDTO::getCreatedDate,
Comparator.nullsFirst(Comparator.naturalOrder())).reversed())

Завантаження…
Відмінити
Зберегти