提交 c7001c36 编写于 作者: zhouweidong's avatar zhouweidong

补充统一资源

上级 fc8e1e19
...@@ -3,18 +3,15 @@ TARGET=PSSYSTEM ...@@ -3,18 +3,15 @@ TARGET=PSSYSTEM
</#ibiztemplate> </#ibiztemplate>
package ${pub.getPKGCodeName()}.util.rest; package ${pub.getPKGCodeName()}.util.rest;
import java.util.ArrayList; import com.alibaba.fastjson.JSONArray;
import java.util.List;
import java.util.Map;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import ${pub.getPKGCodeName()}.util.security.AuthenticationUser;
@RestController @RestController
@RequestMapping(value = "") @RequestMapping(value = "")
...@@ -22,7 +19,14 @@ public class AppController { ...@@ -22,7 +19,14 @@ public class AppController {
@RequestMapping(method = RequestMethod.GET, value = "/appdata") @RequestMapping(method = RequestMethod.GET, value = "/appdata")
public ResponseEntity<JSONObject> getAppData() { public ResponseEntity<JSONObject> getAppData() {
JSONObject appData = new JSONObject() ; JSONObject appData = new JSONObject() ;
JSONArray uniRes=new JSONArray();
JSONObject userPermission=AuthenticationUser.getAuthenticationUser().getPermissionList();
if(!ObjectUtils.isEmpty(userPermission)){
uniRes = userPermission.getJSONArray("unires");
}
appData.put("unires",uniRes);
return ResponseEntity.status(HttpStatus.OK).body(appData); return ResponseEntity.status(HttpStatus.OK).body(appData);
} }
......
...@@ -77,7 +77,7 @@ public class AuthPermissionEvaluator implements PermissionEvaluator { ...@@ -77,7 +77,7 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
return false; return false;
//获取当前用户权限列表 //获取当前用户权限列表
JSONObject userPermission= AuthenticationUser.getAuthenticationUser().getPermisionList(); JSONObject userPermission= AuthenticationUser.getAuthenticationUser().getPermissionList();
if(userPermission==null) if(userPermission==null)
return false; return false;
...@@ -91,7 +91,7 @@ public class AuthPermissionEvaluator implements PermissionEvaluator { ...@@ -91,7 +91,7 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
String entityName = entity.getClass().getSimpleName(); String entityName = entity.getClass().getSimpleName();
//获取实体行为权限信息 //获取实体行为权限信息
JSONObject permissionList=userPermission.getJSONObject("userPermissionList"); JSONObject permissionList=userPermission.getJSONObject("entities");
//检查是否有操作权限[create.update.delete.read] //检查是否有操作权限[create.update.delete.read]
if(!validDEActionHasPermission(permissionList,entityName,action)){ if(!validDEActionHasPermission(permissionList,entityName,action)){
...@@ -109,7 +109,7 @@ public class AuthPermissionEvaluator implements PermissionEvaluator { ...@@ -109,7 +109,7 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
String entityName = entity.getClass().getSimpleName(); String entityName = entity.getClass().getSimpleName();
//获取数据集权限信息 //获取数据集权限信息
JSONObject permissionList=userPermission.getJSONObject("userPermissionList"); JSONObject permissionList=userPermission.getJSONObject("entities");
if(StringUtils.isEmpty(entityName)|| StringUtils.isEmpty(dataSetName)) if(StringUtils.isEmpty(entityName)|| StringUtils.isEmpty(dataSetName))
return false; return false;
...@@ -148,8 +148,8 @@ public class AuthPermissionEvaluator implements PermissionEvaluator { ...@@ -148,8 +148,8 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
if (StringUtils.isEmpty(entity)) if (StringUtils.isEmpty(entity))
return false; return false;
JSONObject userPermission= AuthenticationUser.getAuthenticationUser().getPermisionList(); JSONObject userPermission= AuthenticationUser.getAuthenticationUser().getPermissionList();
JSONObject permissionList=userPermission.getJSONObject("userPermissionList"); JSONObject permissionList=userPermission.getJSONObject("entities");
String entityName = entity.getClass().getSimpleName(); String entityName = entity.getClass().getSimpleName();
if(action.equalsIgnoreCase("create")){ if(action.equalsIgnoreCase("create")){
......
...@@ -64,7 +64,7 @@ public class AuthenticationUser implements UserDetails ...@@ -64,7 +64,7 @@ public class AuthenticationUser implements UserDetails
private Collection<GrantedAuthority> authorities; private Collection<GrantedAuthority> authorities;
@JsonIgnore @JsonIgnore
private int superuser; private int superuser;
private JSONObject permisionList; private JSONObject permissionList;
private String orglevel;//单位级别 private String orglevel;//单位级别
private String deptlevel;//部门级别 private String deptlevel;//部门级别
@JsonIgnore @JsonIgnore
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册