Browse Source

permission改名

NorthLan 6 years ago
parent
commit
22f8e4cbf6

+ 1 - 1
zen-api/src/main/kotlin/com/gxzc/zen/api/sys/service/ISysPermissionService.kt → zen-api/src/main/kotlin/com/gxzc/zen/api/sys/service/IPermissionService.kt

@@ -12,7 +12,7 @@ import org.apache.shiro.session.Session
  * @author NorthLan
  * @since 2018-02-06
  */
-interface ISysPermissionService {
+interface IPermissionService {
 
     /**
      * 获取系统所有权限列表并存入 {code 系统缓存}

+ 2 - 2
zen-api/src/main/kotlin/com/gxzc/zen/api/sys/service/impl/SysPermissionServiceImpl.kt → zen-api/src/main/kotlin/com/gxzc/zen/api/sys/service/impl/PermissionServiceImpl.kt

@@ -2,7 +2,7 @@ package com.gxzc.zen.api.sys.service.impl
 
 import com.alibaba.dubbo.config.annotation.Reference
 import com.gxzc.zen.api.sys.model.SysRole
-import com.gxzc.zen.api.sys.service.ISysPermissionService
+import com.gxzc.zen.api.sys.service.IPermissionService
 import com.gxzc.zen.common.contants.ZenConstants
 import com.gxzc.zen.common.util.RedisCacheUtil
 import com.gxzc.zen.rpc.api.sys.RPermissionService
@@ -24,7 +24,7 @@ import org.springframework.stereotype.Service
  */
 @Service
 @Suppress("UNCHECKED_CAST")
-class SysPermissionServiceImpl : ISysPermissionService {
+class PermissionServiceImpl : IPermissionService {
 
     @Reference(version = "1.0")
     private val rPermissionService: RPermissionService? = null

+ 5 - 5
zen-api/src/main/kotlin/com/gxzc/zen/umps/filter/UrlPermissionsFilter.kt

@@ -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
         }

+ 3 - 3
zen-api/src/main/kotlin/com/gxzc/zen/umps/util/SSOUtil.kt

@@ -3,7 +3,7 @@ package com.gxzc.zen.umps.util
 import com.gxzc.zen.api.sys.common.MenuTree
 import com.gxzc.zen.api.sys.model.SysRole
 import com.gxzc.zen.api.sys.model.SysUser
-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 com.gxzc.zen.umps.constant.ZenHttpSession
@@ -18,7 +18,7 @@ import org.apache.shiro.session.Session
  */
 @Suppress("UNCHECKED_CAST")
 object SSOUtil {
-    private var permissionService: ISysPermissionService? = SpringContextHolder.getBean(ISysPermissionService::class.java)
+    private var permissionService: IPermissionService? = SpringContextHolder.getBean(IPermissionService::class.java)
 
     fun getSession(): Session? {
         return SecurityUtils.getSubject().getSession(false)
@@ -65,7 +65,7 @@ object SSOUtil {
      */
     fun getCurUserPerms(): MutableList<ZenPermission>? {
         if (permissionService == null) {
-            permissionService = SpringContextHolder.getBean(ISysPermissionService::class.java)
+            permissionService = SpringContextHolder.getBean(IPermissionService::class.java)
         }
         return permissionService!!.getSubjectPermission()
     }