提交 e110c1b0 编写于 作者: M megagao

添加了权限判断

上级 321069ad
package org.hqu.production_ms.controller;
import java.util.HashMap;
import java.util.Map;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.subject.Subject;
import org.hqu.production_ms.domain.COrder;
import org.hqu.production_ms.domain.CustomResult;
import org.hqu.production_ms.domain.EUDataGridResult;
......@@ -31,11 +37,33 @@ public class OrderController {
return "order_list";
}
@RequestMapping("/add_judge")
@ResponseBody
public Map<String,Object> orderAddJudge() {
Map<String,Object> map = new HashMap<String,Object>();
Subject currentUser = SecurityUtils.getSubject();
if(!currentUser.isPermitted("order:add")){
map.put("msg", "您没有权限,请切换用户登录!");
}
return map;
}
@RequestMapping("/add")
public String add() {
return "order_add";
}
@RequestMapping("/edit_judge")
@ResponseBody
public Map<String,Object> orderEditJudge() {
Map<String,Object> map = new HashMap<String,Object>();
Subject currentUser = SecurityUtils.getSubject();
if(!currentUser.isPermitted("order:edit")){
map.put("msg", "您没有权限,请切换用户登录!");
}
return map;
}
@RequestMapping("/edit")
public String edit() {
return "order_edit";
......@@ -55,6 +83,17 @@ public class OrderController {
return result;
}
@RequestMapping("/update_judge")
@ResponseBody
public Map<String,Object> orderUpdateJudge() {
Map<String,Object> map = new HashMap<String,Object>();
Subject currentUser = SecurityUtils.getSubject();
if(!currentUser.isPermitted("order:update")){
map.put("msg", "您没有权限,请切换用户登录!");
}
return map;
}
@RequestMapping(value="/update")
@ResponseBody
private CustomResult update(COrderPO cOrder) throws Exception {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册