package com.gxzc.zen.ump import com.baomidou.kisso.SSOAuthorization import com.baomidou.kisso.security.token.SSOToken import com.gxzc.zen.api.sys.service.ISysPermissionService import com.gxzc.zen.common.util.SpringContextHolder import org.apache.commons.lang3.StringUtils class KissoAuthorization:SSOAuthorization { private val permissionService=SpringContextHolder.getBean(ISysPermissionService::class.java) override fun isPermitted(token: SSOToken?, permission: String?): Boolean { if(token==null)return false if(!StringUtils.isNumeric(token.id))return false val pers=permissionService?.findUserPermissions(token?.id?.toLong()!!) if(pers?.contains(permission)!!)return true return false } }