@Test public void validatePermisionTest() throws Exception { LoginUser user = LoginUser.builder().id(1L).build(); DasGroup group = DasGroup.builder().group_name("name").build(); Errors errors = new BeanPropertyBindingResult(group, "group", true, 256); Assert.assertTrue(groupService.validatePermision(user, errors).validate().isValid()); }
public ValidatorChain validatePermision(LoginUser user, Errors errors) throws SQLException { return ValidatorChain.newInstance().controllerValidate(errors) .addAssert(() -> permissionService.isManagerById(user.getId()), message.group_message_no_pemission); }
GroupService { public ValidatorChain validatePermision(LoginUser user, Errors errors) throws SQLException { return ValidatorChain.newInstance().controllerValidate(errors) .addAssert(() -> permissionService.isManagerById(user.getId()), message.group_message_no_pemission); } }
GroupService { public ValidatorChain validatePermision(LoginUser user, Errors errors) throws SQLException { return ValidatorChain.newInstance().controllerValidate(errors) .addAssert(() -> permissionService.isManagerById(user.getId()), message.group_message_no_pemission); }  }
GroupService { public ValidatorChain validatePermision(LoginUser user, Errors errors) throws SQLException { return ValidatorChain.newInstance().controllerValidate(errors) .addAssert(() -> permissionService.isManagerById(user.getId()), message.group_message_no_pemission); }  ValidatorChain validatePermision(LoginUser user, Errors errors); boolean addDalGroup(LoginUser user, DasGroup group); boolean updateDalGroup(LoginUser user, DasGroup group); boolean isInSuperGroup(String userNo); boolean isInCurrentGroup(Long userId, int currentGroupId); ListResult<DalGroupView> findGroupPageList(Paging<DasGroup> paging); boolean isNotExistByName(DasGroup group); boolean isNotExistInProjectAndGroup(String name); int initAdminGroup(); }
GroupService { public ValidatorChain validatePermision(LoginUser user, Errors errors) throws SQLException { return ValidatorChain.newInstance().controllerValidate(errors) .addAssert(() -> permissionService.isManagerById(user.getId()), message.group_message_no_pemission); }  ValidatorChain validatePermision(LoginUser user, Errors errors); boolean addDalGroup(LoginUser user, DasGroup group); boolean updateDalGroup(LoginUser user, DasGroup group); boolean isInSuperGroup(String userNo); boolean isInCurrentGroup(Long userId, int currentGroupId); ListResult<DalGroupView> findGroupPageList(Paging<DasGroup> paging); boolean isNotExistByName(DasGroup group); boolean isNotExistInProjectAndGroup(String name); int initAdminGroup();  }