|
1 | 1 | package com.glaum.login.controller; |
2 | 2 |
|
3 | | -import com.glaum.login.model.User; |
4 | 3 | import org.slf4j.Logger; |
5 | 4 | import org.slf4j.LoggerFactory; |
| 5 | +import org.springframework.beans.factory.annotation.Autowired; |
6 | 6 | import org.springframework.security.access.prepost.PreAuthorize; |
7 | 7 | import org.springframework.stereotype.Controller; |
8 | 8 | import org.springframework.ui.Model; |
| 9 | +import org.springframework.web.bind.annotation.PathVariable; |
9 | 10 | import org.springframework.web.bind.annotation.RequestMapping; |
10 | 11 | import org.springframework.web.bind.annotation.RequestMethod; |
11 | 12 |
|
| 13 | +import com.glaum.login.configuration.Authorized; |
| 14 | +import com.glaum.login.entity.permission; |
| 15 | + |
12 | 16 | import java.io.IOException; |
| 17 | +import java.util.List; |
13 | 18 | import java.util.Map; |
14 | 19 |
|
| 20 | +import javax.servlet.http.HttpServletRequest; |
| 21 | +import javax.servlet.http.HttpServletResponse; |
| 22 | +import javax.servlet.http.HttpSession; |
| 23 | + |
15 | 24 | @Controller |
16 | 25 | public class CustomerController { |
17 | 26 |
|
| 27 | + @Autowired |
| 28 | + HttpSession httpsessionobj; |
| 29 | + |
| 30 | + |
| 31 | + |
18 | 32 | private static final Logger LOGGER = LoggerFactory.getLogger(CustomerController.class); |
19 | | - |
| 33 | + |
| 34 | + //@PreAuthorize("hasPermission('customer', #httpSession)") |
20 | 35 | @RequestMapping(value={"/customer"}, method = RequestMethod.GET) |
21 | | - public String customer() throws IOException { |
| 36 | + @Authorized(keys = "view_dashboard") |
| 37 | + public String customer(HttpSession httpSession,HttpServletRequest request,HttpServletResponse res) throws IOException { |
| 38 | + |
| 39 | + return "admin_customer"; |
| 40 | + } |
| 41 | + |
| 42 | + @RequestMapping(value={"/quote_delete"}, method = RequestMethod.GET) |
| 43 | + @Authorized(keys = {"quote_delete","quote_read","quote_create"}) |
| 44 | + public String customerdel(HttpSession httpSession,HttpServletRequest request,HttpServletResponse res) throws IOException { |
| 45 | + |
22 | 46 | return "admin_customer"; |
23 | 47 | } |
| 48 | + |
| 49 | + |
24 | 50 |
|
25 | 51 | } |
0 commit comments