提交 1b43da9e 编写于 作者: sq3536's avatar sq3536

权限调整

上级 18f5c1a9
...@@ -313,27 +313,33 @@ public class ApiMethodModel extends BaseModel { ...@@ -313,27 +313,33 @@ public class ApiMethodModel extends BaseModel {
permission.put("ano", "PreAuthorize"); permission.put("ano", "PreAuthorize");
this.getInParam(); this.getInParam();
if(this.getApiEntity()==null||this.getApiEntity().getEntity()==null||(!this.getApiEntity().getEntity().isHasScopes())) { if(this.getApiEntity()==null||this.getApiEntity().getEntity()==null||(!this.getApiEntity().getEntity().isHasScopes())) {
permission.put("cond","hasAnyAuthority('ROLE_SUPERADMIN','"+this.getApiEntity().getEntity().getSystem().getProjectName()+"-"+this.getApiEntity().getEntity().getCodeName()+"-"+this.getName()+"-all')"); if("FETCH".equalsIgnoreCase(getPSDEServiceAPIMethod().getMethodType())) {
permission.put("cond","hasAnyAuthority('ROLE_SUPERADMIN','"+this.getApiEntity().getEntity().getSystem().getDeploySysId()+"-"+this.getApiEntity().getEntity().getCodeName()+"-"+this.getName().replace("Fetch","search")+"-all','"+this.getApiEntity().getEntity().getSystem().getDeploySysId()+"-"+this.getApiEntity().getEntity().getCodeName()+"-Get-all')");
}
else if (this.getPSDEServiceAPIMethod().getPSDEAction()!=null&&this.getPSDEServiceAPIMethod().getPSDEAction().getPSDEOPPriv()==null&&(!lang.containsKey(this.getName().toUpperCase())))
permission.put("cond","hasAnyAuthority('ROLE_SUPERADMIN','"+this.getApiEntity().getEntity().getSystem().getDeploySysId()+"-"+this.getApiEntity().getEntity().getCodeName()+"-"+this.getName()+"-all','"+this.getApiEntity().getEntity().getSystem().getDeploySysId()+"-"+this.getApiEntity().getEntity().getCodeName()+"-Get-all')");
else
permission.put("cond","hasAnyAuthority('ROLE_SUPERADMIN','"+this.getApiEntity().getEntity().getSystem().getDeploySysId()+"-"+this.getApiEntity().getEntity().getCodeName()+"-"+this.getName()+"-all')");
} }
else if("FETCH".equalsIgnoreCase(getPSDEServiceAPIMethod().getMethodType())) else if("FETCH".equalsIgnoreCase(getPSDEServiceAPIMethod().getMethodType()))
{ {
permission.put("cond","hasAnyAuthority('ROLE_SUPERADMIN','"+this.getApiEntity().getEntity().getSystem().getProjectName()+"-"+this.getApiEntity().getEntity().getCodeName()+"-"+this.getName().replace("Fetch","search")+"-all')"+ permission.put("cond","hasAnyAuthority('ROLE_SUPERADMIN','"+this.getApiEntity().getEntity().getSystem().getDeploySysId()+"-"+this.getApiEntity().getEntity().getCodeName()+"-"+this.getName().replace("Fetch","search")+"-all','"+this.getApiEntity().getEntity().getSystem().getDeploySysId()+"-"+this.getApiEntity().getEntity().getCodeName()+"-Get-all')"+
" and hasPermission(#"+this.getInParamName()+",'"+this.getApiEntity().getEntity().getSystem().getProjectName()+"-"+this.getApiEntity().getEntity().getCodeName()+"-Get')"); " and hasPermission(#"+this.getInParamName()+",'"+this.getApiEntity().getEntity().getSystem().getDeploySysId()+"-"+this.getApiEntity().getEntity().getCodeName()+"-Get')");
} }
else if(this.getName().equalsIgnoreCase("Get")) else if(this.getName().equalsIgnoreCase("Get"))
{ {
permission.put("ano", "PostAuthorize"); permission.put("ano", "PostAuthorize");
permission.put("cond","hasPermission(this."+StringAdvUtils.camelcase(this.getApiEntity().getDefaultDto().getCodeName())+"Mapping.toDomain(returnObject.body),'"+this.getApiEntity().getEntity().getSystem().getProjectName()+"-"+this.getApiEntity().getEntity().getCodeName()+"-"+this.getName()+"')"); permission.put("cond","hasPermission(this."+StringAdvUtils.camelcase(this.getApiEntity().getDefaultDto().getCodeName())+"Mapping.toDomain(returnObject.body),'"+this.getApiEntity().getEntity().getSystem().getDeploySysId()+"-"+this.getApiEntity().getEntity().getCodeName()+"-"+this.getName()+"')");
} }
else if(this.getName().equalsIgnoreCase("Update")||this.getName().equalsIgnoreCase("Remove")||ObjectUtils.isEmpty(this.getInParam())) else if(this.getName().equalsIgnoreCase("Update")||this.getName().equalsIgnoreCase("Remove")||ObjectUtils.isEmpty(this.getInParam()))
{ {
permission.put("cond","hasPermission(this."+StringAdvUtils.camelcase(this.getApiEntity().getEntity().getCodeName())+"Service.get(#"+StringAdvUtils.camelcase(apiEntity.getEntity().getKeyField().getCodeName())+"),'"+this.getApiEntity().getEntity().getSystem().getProjectName()+"-"+this.getApiEntity().getEntity().getCodeName()+"-"+this.getName()+"')"); permission.put("cond","hasPermission(this."+StringAdvUtils.camelcase(this.getApiEntity().getEntity().getCodeName())+"Service.get(#"+StringAdvUtils.camelcase(apiEntity.getEntity().getKeyField().getCodeName())+"),'"+this.getApiEntity().getEntity().getSystem().getDeploySysId()+"-"+this.getApiEntity().getEntity().getCodeName()+"-"+this.getName()+"')");
} }
else if(this.getName().equalsIgnoreCase("Create")||this.getName().equalsIgnoreCase("Save")||this.isNeedDto2Domain()) else if(this.getName().equalsIgnoreCase("Create")||this.getName().equalsIgnoreCase("Save")||this.isNeedDto2Domain())
{ {
permission.put("cond","hasPermission(this."+StringAdvUtils.camelcase(this.getApiEntity().getDefaultDto().getCodeName())+"Mapping.toDomain(#"+this.getInParamName()+"),'"+this.getApiEntity().getEntity().getSystem().getProjectName()+"-"+this.getApiEntity().getEntity().getCodeName()+"-"+this.getName()+"')"); permission.put("cond","hasPermission(this."+StringAdvUtils.camelcase(this.getApiEntity().getDefaultDto().getCodeName())+"Mapping.toDomain(#"+this.getInParamName()+"),'"+this.getApiEntity().getEntity().getSystem().getDeploySysId()+"-"+this.getApiEntity().getEntity().getCodeName()+"-"+this.getName()+"')");
} }
return permission; return permission;
} }
......
...@@ -166,7 +166,7 @@ public class AppEntityModel extends BaseModel{ ...@@ -166,7 +166,7 @@ public class AppEntityModel extends BaseModel{
if(getEntity().getDataEntity().getStorageMode()==4 && (!"MIDDLEPLATFORM".equals(sybSysServiceType)) && (!"MASA".equals(sybSysServiceType))) if(getEntity().getDataEntity().getStorageMode()==4 && (!"MIDDLEPLATFORM".equals(sybSysServiceType)) && (!"MASA".equals(sybSysServiceType)))
serviceId = getEntity().getDataEntity().getPSSubSysServiceAPI().getServiceCodeName(); serviceId = getEntity().getDataEntity().getPSSubSysServiceAPI().getServiceCodeName();
else if (getAppDataEntity().getPSSysServiceAPI()!=null) else if (getAppDataEntity().getPSSysServiceAPI()!=null)
serviceId = app.getSystem().getProjectName()+"-"+ getAppDataEntity().getPSSysServiceAPI().getCodeName().toLowerCase(); serviceId = app.getSystem().getDeploySysId().toLowerCase()+"-"+ getAppDataEntity().getPSSysServiceAPI().getCodeName().toLowerCase();
} }
return serviceId; return serviceId;
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册