Index: src/main/java/com/example/autopartz/config/WebSecurityConfig.java
===================================================================
--- src/main/java/com/example/autopartz/config/WebSecurityConfig.java	(revision 676144b5d7767da390db57a3951adafca68b2fc4)
+++ src/main/java/com/example/autopartz/config/WebSecurityConfig.java	(revision 1bd8d1ecea6caeb46112d4e4b23379b6bbd9ce31)
@@ -28,6 +28,7 @@
         http.csrf().disable()
                 .authorizeRequests()
-                .antMatchers("/", "/products", "/services", "/filtered", "/login", "/register","/registerWarehouseman","/finishRegister","/test/*","/viewUsers","/approve/*").permitAll()
+                .antMatchers("/", "/products", "/services", "/filtered", "/login", "/register","/registerWarehouseman","/finishRegister","/test/*","/access_denied").permitAll()
                 .antMatchers("/orders","/repairs","/reviews","/part/*","/currentOrder").hasRole("CLIENT")
+                .antMatchers("/viewUsers","/approve/*").hasRole("ADMIN")
                 .anyRequest()
                 .authenticated()
Index: src/main/java/com/example/autopartz/controller/AdminController.java
===================================================================
--- src/main/java/com/example/autopartz/controller/AdminController.java	(revision 676144b5d7767da390db57a3951adafca68b2fc4)
+++ src/main/java/com/example/autopartz/controller/AdminController.java	(revision 1bd8d1ecea6caeb46112d4e4b23379b6bbd9ce31)
@@ -13,4 +13,5 @@
 import org.springframework.web.bind.annotation.RequestMapping;
 
+import javax.annotation.security.RolesAllowed;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
Index: src/main/java/com/example/autopartz/controller/HomeController.java
===================================================================
--- src/main/java/com/example/autopartz/controller/HomeController.java	(revision 676144b5d7767da390db57a3951adafca68b2fc4)
+++ src/main/java/com/example/autopartz/controller/HomeController.java	(revision 1bd8d1ecea6caeb46112d4e4b23379b6bbd9ce31)
@@ -1,11 +1,7 @@
 package com.example.autopartz.controller;
 
-import com.example.autopartz.model.Order;
-import com.example.autopartz.model.User;
-import com.example.autopartz.model.Warehouse;
-import com.example.autopartz.repository.OrderContainsPartRepository;
-import com.example.autopartz.repository.PartsForCarTypeAndCategoryRepository;
-import com.example.autopartz.repository.RepairShopReviewSummaryRepository;
-import com.example.autopartz.repository.WarehouseRepository;
+import com.example.autopartz.model.*;
+import com.example.autopartz.model.manytomany.PartIsInStockInWarehouse;
+import com.example.autopartz.repository.*;
 import com.example.autopartz.service.*;
 import org.springframework.stereotype.Controller;
@@ -20,4 +16,5 @@
 import javax.servlet.http.HttpSession;
 import java.io.IOException;
+import java.util.List;
 import java.util.Objects;
 
@@ -34,7 +31,9 @@
     private final OrderContainsPartRepository orderContainsPartRepository;
     private final OrderService orderService;
-
+    private final UserService userService;
+    private final DeliveryService deliveryService;
+    private final PartIsInStockInWarehouseRepository partIsInStockInWarehouseRepository;
     public HomeController(LoginService loginService, PartService partService, PartsForCarTypeAndCategoryRepository partsForCarTypeAndCategoryRepository, CarService carService, CategoryService categoryService, RepairShopReviewSummaryRepository repairShopReviewSummaryRepository, WarehouseRepository warehouseRepository,
-                          OrderContainsPartRepository orderContainsPartRepository, OrderService orderService) {
+                          OrderContainsPartRepository orderContainsPartRepository, OrderService orderService, UserService userService, DeliveryService deliveryService, PartIsInStockInWarehouseRepository partIsInStockInWarehouseRepository) {
         this.loginService = loginService;
         this.partService = partService;
@@ -46,4 +45,7 @@
         this.orderContainsPartRepository = orderContainsPartRepository;
         this.orderService = orderService;
+        this.userService = userService;
+        this.deliveryService = deliveryService;
+        this.partIsInStockInWarehouseRepository = partIsInStockInWarehouseRepository;
     }
 
@@ -78,5 +80,5 @@
             model.addAttribute("hasError",false);
             model.addAttribute("order",o);
-            model.addAttribute("parts",orderService.findById(o.getID_order()).getPartList());
+            model.addAttribute("parts",orderService.findById(o.getOrderid()).getPartList());
         }
         model.addAttribute("bodyContent","currentOrder");
@@ -154,3 +156,26 @@
         }
     }
+    @GetMapping("/access_denied")
+    public String accessDenied(Model model){
+        model.addAttribute("bodyContent","access_denied");
+        return "master-template";
+    }
+    @GetMapping("/myWarehouse")
+    public String myWarehouse(Model model, HttpServletRequest request){
+        Warehouseman whm = (Warehouseman) userService.findByUsername(request.getRemoteUser());
+        Warehouse warehouse = whm.getWarehouse();
+        List<PartIsInStockInWarehouse> partIsInStockInWarehouseList = partIsInStockInWarehouseRepository.findAllByWarehouseid(warehouse.getID_warehouse());
+        model.addAttribute("bodyContent","myWarehouse");
+        model.addAttribute("warehouse",warehouse);
+        model.addAttribute("parts", partIsInStockInWarehouseList);
+        return "master-template";
+    }
+    @GetMapping("myDeliveries")
+    public String myDeliveries(Model model, HttpServletRequest request){
+        Deliveryman dm = (Deliveryman) userService.findByUsername(request.getRemoteUser());
+        List<Delivery> deliveries = deliveryService.findAllByDeliverer(dm);
+        model.addAttribute("bodyContent","myDeliveries");
+        model.addAttribute("deliveries",deliveries);
+        return "master-template";
+    }
 }
Index: src/main/java/com/example/autopartz/controller/PartController.java
===================================================================
--- src/main/java/com/example/autopartz/controller/PartController.java	(revision 676144b5d7767da390db57a3951adafca68b2fc4)
+++ src/main/java/com/example/autopartz/controller/PartController.java	(revision 1bd8d1ecea6caeb46112d4e4b23379b6bbd9ce31)
@@ -77,5 +77,5 @@
         }
         Order order = (Order) session.getAttribute("order");
-        orderContainsPartRepository.save(new OrderContainsPart(id,order.getID_order(),quantity));
+        orderContainsPartRepository.save(new OrderContainsPart(id,order.getOrderid(),quantity));
         try {
             response.sendRedirect("/products");
Index: src/main/java/com/example/autopartz/controller/TestController.java
===================================================================
--- src/main/java/com/example/autopartz/controller/TestController.java	(revision 676144b5d7767da390db57a3951adafca68b2fc4)
+++ src/main/java/com/example/autopartz/controller/TestController.java	(revision 1bd8d1ecea6caeb46112d4e4b23379b6bbd9ce31)
@@ -36,6 +36,6 @@
         User u = userService.findByUsername("client13");
         Order o = orderService.create((Client) u);
-        orderContainsPartRepository.save(new OrderContainsPart(5,o.getID_order(),2));
-        orderContainsPartRepository.save(new OrderContainsPart(7,o.getID_order(),1));
+        orderContainsPartRepository.save(new OrderContainsPart(5,o.getOrderid(),2));
+        orderContainsPartRepository.save(new OrderContainsPart(7,o.getOrderid(),1));
     }
     @GetMapping("/t")
Index: src/main/java/com/example/autopartz/model/Delivery.java
===================================================================
--- src/main/java/com/example/autopartz/model/Delivery.java	(revision 676144b5d7767da390db57a3951adafca68b2fc4)
+++ src/main/java/com/example/autopartz/model/Delivery.java	(revision 1bd8d1ecea6caeb46112d4e4b23379b6bbd9ce31)
@@ -18,6 +18,8 @@
     @Id
     Integer ID_delivery;
-    String delivery_status;
-    String delivery_address;
+    @Column(name = "delivery_status")
+    String status;
+    @Column(name = "delivery_address")
+    String address;
     @ManyToOne
     @JoinColumn(name = "id_user")
Index: src/main/java/com/example/autopartz/model/Order.java
===================================================================
--- src/main/java/com/example/autopartz/model/Order.java	(revision 676144b5d7767da390db57a3951adafca68b2fc4)
+++ src/main/java/com/example/autopartz/model/Order.java	(revision 1bd8d1ecea6caeb46112d4e4b23379b6bbd9ce31)
@@ -21,7 +21,9 @@
     @Id
     @GeneratedValue(strategy = GenerationType.IDENTITY)
-    Integer ID_order;
+    @Column(name = "ID_order")
+    Integer orderid;
     String order_status;
-    LocalDateTime order_date;
+    @Column(name = "order_date")
+    LocalDateTime date;
     @JoinColumn(name = "id_user")
     @ManyToOne
@@ -37,5 +39,5 @@
         this.order_status = "created";
         this.user = user;
-        this.order_date = LocalDateTime.now();
+        this.date = LocalDateTime.now();
     }
 
@@ -45,5 +47,5 @@
         if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
         Order order = (Order) o;
-        return ID_order != null && Objects.equals(ID_order, order.ID_order);
+        return orderid != null && Objects.equals(orderid, order.orderid);
     }
 
Index: src/main/java/com/example/autopartz/model/manytomany/PartIsInStockInWarehouse.java
===================================================================
--- src/main/java/com/example/autopartz/model/manytomany/PartIsInStockInWarehouse.java	(revision 1bd8d1ecea6caeb46112d4e4b23379b6bbd9ce31)
+++ src/main/java/com/example/autopartz/model/manytomany/PartIsInStockInWarehouse.java	(revision 1bd8d1ecea6caeb46112d4e4b23379b6bbd9ce31)
@@ -0,0 +1,26 @@
+package com.example.autopartz.model.manytomany;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+import lombok.ToString;
+
+import javax.persistence.*;
+
+@Entity
+@Getter
+@Setter
+@ToString
+@RequiredArgsConstructor
+@Table(name = "`part_is_in_stock_in_warehouse`")
+@IdClass(PartIsInStockInWarehouseId.class)
+public class PartIsInStockInWarehouse {
+    @Id
+    @Column(name = "id_part")
+    Integer partid;
+    @Column(name = "id_warehouse")
+    @Id
+    Integer warehouseid;
+    @Column(name = "quantity_warehouse")
+    Integer quantity;
+}
Index: src/main/java/com/example/autopartz/model/manytomany/PartIsInStockInWarehouseId.java
===================================================================
--- src/main/java/com/example/autopartz/model/manytomany/PartIsInStockInWarehouseId.java	(revision 1bd8d1ecea6caeb46112d4e4b23379b6bbd9ce31)
+++ src/main/java/com/example/autopartz/model/manytomany/PartIsInStockInWarehouseId.java	(revision 1bd8d1ecea6caeb46112d4e4b23379b6bbd9ce31)
@@ -0,0 +1,11 @@
+package com.example.autopartz.model.manytomany;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class PartIsInStockInWarehouseId implements Serializable {
+    Integer partid;
+    Integer warehouseid;
+}
Index: src/main/java/com/example/autopartz/repository/DeliveryRepository.java
===================================================================
--- src/main/java/com/example/autopartz/repository/DeliveryRepository.java	(revision 1bd8d1ecea6caeb46112d4e4b23379b6bbd9ce31)
+++ src/main/java/com/example/autopartz/repository/DeliveryRepository.java	(revision 1bd8d1ecea6caeb46112d4e4b23379b6bbd9ce31)
@@ -0,0 +1,13 @@
+package com.example.autopartz.repository;
+
+import com.example.autopartz.model.Delivery;
+import com.example.autopartz.model.Deliveryman;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public interface DeliveryRepository extends JpaRepository<Delivery,Integer> {
+    List<Delivery> findAllByDeliveryman(Deliveryman deliveryman);
+}
Index: src/main/java/com/example/autopartz/repository/PartIsInStockInWarehouseRepository.java
===================================================================
--- src/main/java/com/example/autopartz/repository/PartIsInStockInWarehouseRepository.java	(revision 1bd8d1ecea6caeb46112d4e4b23379b6bbd9ce31)
+++ src/main/java/com/example/autopartz/repository/PartIsInStockInWarehouseRepository.java	(revision 1bd8d1ecea6caeb46112d4e4b23379b6bbd9ce31)
@@ -0,0 +1,11 @@
+package com.example.autopartz.repository;
+
+import com.example.autopartz.model.manytomany.PartIsInStockInWarehouse;
+import com.example.autopartz.model.manytomany.PartIsInStockInWarehouseId;
+import org.springframework.data.jpa.repository.JpaRepository;
+
+import java.util.List;
+
+public interface PartIsInStockInWarehouseRepository extends JpaRepository<PartIsInStockInWarehouse, PartIsInStockInWarehouseId> {
+    List<PartIsInStockInWarehouse> findAllByWarehouseid(Integer warehouseid);
+}
Index: src/main/java/com/example/autopartz/service/DeliveryService.java
===================================================================
--- src/main/java/com/example/autopartz/service/DeliveryService.java	(revision 1bd8d1ecea6caeb46112d4e4b23379b6bbd9ce31)
+++ src/main/java/com/example/autopartz/service/DeliveryService.java	(revision 1bd8d1ecea6caeb46112d4e4b23379b6bbd9ce31)
@@ -0,0 +1,10 @@
+package com.example.autopartz.service;
+
+import com.example.autopartz.model.Delivery;
+import com.example.autopartz.model.Deliveryman;
+
+import java.util.List;
+
+public interface DeliveryService {
+    List<Delivery> findAllByDeliverer(Deliveryman dm);
+}
Index: src/main/java/com/example/autopartz/service/impl/DeliveryServiceImpl.java
===================================================================
--- src/main/java/com/example/autopartz/service/impl/DeliveryServiceImpl.java	(revision 1bd8d1ecea6caeb46112d4e4b23379b6bbd9ce31)
+++ src/main/java/com/example/autopartz/service/impl/DeliveryServiceImpl.java	(revision 1bd8d1ecea6caeb46112d4e4b23379b6bbd9ce31)
@@ -0,0 +1,23 @@
+package com.example.autopartz.service.impl;
+
+import com.example.autopartz.model.Delivery;
+import com.example.autopartz.model.Deliveryman;
+import com.example.autopartz.repository.DeliveryRepository;
+import com.example.autopartz.service.DeliveryService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class DeliveryServiceImpl implements DeliveryService {
+    private final DeliveryRepository deliveryRepository;
+
+    public DeliveryServiceImpl(DeliveryRepository deliveryRepository) {
+        this.deliveryRepository = deliveryRepository;
+    }
+
+    @Override
+    public List<Delivery> findAllByDeliverer(Deliveryman dm) {
+        return deliveryRepository.findAllByDeliveryman(dm);
+    }
+}
