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

开放resource batch权限校验

上级 2ca7e993
......@@ -608,6 +608,7 @@ public class ${itemCodeName}Resource {
</#if>
</#if>
<#comment>单条数据Security权限校验</#comment>
<#macro SecurityAnnotation deaction>
<#if de.getStorageMode()==1 || de.getStorageMode()==2>
<#if hasDEPrefield==false>
......@@ -626,17 +627,18 @@ public class ${itemCodeName}Resource {
</#if>
</#macro>
<#comment>批量数据Security权限校验</#comment>
<#macro SecurityBatchAnnotation deaction>
<#if de.getStorageMode()==1 || de.getStorageMode()==2>
<#if hasDEPrefield==false>
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','${sys.codeName}-${de.codeName}-${deaction.codeName}-all')")
<#else>
<#if deaction.codeName?lower_case=='remove'>
//@PreAuthorize("hasPermission(this.${deCodeNameLC}Service.get${deCodeNameCamel}ByIds(#ids),'${sys.codeName}-${de.codeName}-${deaction.codeName}')")
@PreAuthorize("hasPermission(this.${deCodeNameLC}Service.get${deCodeNameCamel}ByIds(#ids),'${sys.codeName}-${de.codeName}-${deaction.codeName}')")
<#elseif deaction.codeName?lower_case=='update'>
//@PreAuthorize("hasPermission(this.${deCodeNameLC}Service.get${deCodeNameCamel}ByEntities(this.${itemCodeNameLC}Mapping.toDomain(#${itemCodeNameLC}dtos)),'${sys.codeName}-${de.codeName}-${deaction.codeName}')")
@PreAuthorize("hasPermission(this.${deCodeNameLC}Service.get${deCodeNameCamel}ByEntities(this.${itemCodeNameLC}Mapping.toDomain(#${itemCodeNameLC}dtos)),'${sys.codeName}-${de.codeName}-${deaction.codeName}')")
<#else>
//@PreAuthorize("hasPermission(this.${itemCodeNameLC}Mapping.toDomain(#${itemCodeNameLC}dtos),'${sys.codeName}-${de.codeName}-${deaction.codeName}')")
@PreAuthorize("hasPermission(this.${itemCodeNameLC}Mapping.toDomain(#${itemCodeNameLC}dtos),'${sys.codeName}-${de.codeName}-${deaction.codeName}')")
</#if>
</#if>
</#if>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册