@Test public void canUpdateOrDeleteUserTest() throws SQLException { Assert.assertTrue(userService.canUpdateOrDeleteUser(currentUser, newUser)); }
public boolean canUpdateOrDeleteUser(LoginUser currentUser, LoginUser newUser) throws SQLException { if (permissionService.isSuperManagerById(currentUser.getId())) { return true; } return canUpdateOrDeleteUser(currentUser.getId(), currentUser.getRole(), newUser.getId(), newUser.getRole()); }
UserService { public boolean canUpdateOrDeleteUser(LoginUser currentUser, LoginUser newUser) throws SQLException { if (permissionService.isSuperManagerById(currentUser.getId())) { return true; } return canUpdateOrDeleteUser(currentUser.getId(), currentUser.getRole(), newUser.getId(), newUser.getRole()); } }
UserService { public boolean canUpdateOrDeleteUser(LoginUser currentUser, LoginUser newUser) throws SQLException { if (permissionService.isSuperManagerById(currentUser.getId())) { return true; } return canUpdateOrDeleteUser(currentUser.getId(), currentUser.getRole(), newUser.getId(), newUser.getRole()); }  }
UserService { public boolean canUpdateOrDeleteUser(LoginUser currentUser, LoginUser newUser) throws SQLException { if (permissionService.isSuperManagerById(currentUser.getId())) { return true; } return canUpdateOrDeleteUser(currentUser.getId(), currentUser.getRole(), newUser.getId(), newUser.getRole()); }  ValidatorChain validatePermision(LoginUser user, Errors errors); boolean canUpdateOrDeleteUser(LoginUser currentUser, LoginUser newUser); boolean canUpdateOrDeleteUser(Long userId, Integer userRole, Long newUserId, Integer newUserRole); boolean addUser(LoginUser user); boolean update(LoginUser user); ListResult<LoginUserView> findUserPageList(Paging<LoginUser> paging); boolean initAdminInfo(LoginUser user); boolean register(LoginUser user); ServiceResult<LoginUser> getUserInfoByWorkName(LoginUser user, String name); ServiceResult getUserManageButton(LoginUser user); }
UserService { public boolean canUpdateOrDeleteUser(LoginUser currentUser, LoginUser newUser) throws SQLException { if (permissionService.isSuperManagerById(currentUser.getId())) { return true; } return canUpdateOrDeleteUser(currentUser.getId(), currentUser.getRole(), newUser.getId(), newUser.getRole()); }  ValidatorChain validatePermision(LoginUser user, Errors errors); boolean canUpdateOrDeleteUser(LoginUser currentUser, LoginUser newUser); boolean canUpdateOrDeleteUser(Long userId, Integer userRole, Long newUserId, Integer newUserRole); boolean addUser(LoginUser user); boolean update(LoginUser user); ListResult<LoginUserView> findUserPageList(Paging<LoginUser> paging); boolean initAdminInfo(LoginUser user); boolean register(LoginUser user); ServiceResult<LoginUser> getUserInfoByWorkName(LoginUser user, String name); ServiceResult getUserManageButton(LoginUser user);  }