|
@@ -1,6 +1,6 @@
|
|
|
package com.gxzc.zen.umps.filter
|
|
|
|
|
|
-import com.gxzc.zen.api.sys.service.ISysPermissionService
|
|
|
+import com.gxzc.zen.api.sys.service.IPermissionService
|
|
|
import com.gxzc.zen.common.util.SpringContextHolder
|
|
|
import com.gxzc.zen.umps.common.ZenPermission
|
|
|
import org.apache.shiro.web.filter.PathMatchingFilter
|
|
@@ -25,10 +25,10 @@ class UrlPermissionsFilter : PathMatchingFilter() {
|
|
|
* 此物只应天上有
|
|
|
* filter比servlet更先初始化,反正就是不能自动注入
|
|
|
*/
|
|
|
- private var sysPermissionService: ISysPermissionService? = null
|
|
|
+ private var permissionService: IPermissionService? = null
|
|
|
get() {
|
|
|
if (field == null) {
|
|
|
- field = SpringContextHolder.getBean(ISysPermissionService::class.java)
|
|
|
+ field = SpringContextHolder.getBean(IPermissionService::class.java)
|
|
|
}
|
|
|
return field
|
|
|
}
|
|
@@ -42,7 +42,7 @@ class UrlPermissionsFilter : PathMatchingFilter() {
|
|
|
}
|
|
|
|
|
|
// 获取系统权限列表(数据库中定义的)
|
|
|
- val sysPerms = sysPermissionService!!.getAllSysPermission()
|
|
|
+ val sysPerms = permissionService!!.getAllSysPermission()
|
|
|
|
|
|
// 根据请求url获取 系统 需要判定权限的url
|
|
|
val permission = getPermissionIfs(sysPerms, request.requestURI, request.method)
|
|
@@ -80,7 +80,7 @@ class UrlPermissionsFilter : PathMatchingFilter() {
|
|
|
* 检查用户权限
|
|
|
*/
|
|
|
private fun checkPermission(perms: List<ZenPermission>): Boolean {
|
|
|
- val userPermission = sysPermissionService!!.getSubjectPermission()
|
|
|
+ val userPermission = permissionService!!.getSubjectPermission()
|
|
|
if (userPermission.isEmpty()) {
|
|
|
return false
|
|
|
}
|