jhipster find all records for admin and findByUserIsCurrentUser for current user

Problem :
Normal user should not fetch all the records in entity ,and admin user should be able to fetch the records.


 public List<FoodItem> getAllFoodItems() {
        log.debug("REST request to get all FoodItems");
        return foodItemRepository.findAll();
         return foodItemRepository.findByUserIsCurrentUser();


Popular posts from this blog

Angular cli ng command is not working

warning: LF will be replaced by CRLF in