You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.3 KiB
45 lines
1.3 KiB
package com.fr.design.mainframe.authority; |
|
|
|
import org.jetbrains.annotations.Nullable; |
|
import sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl; |
|
|
|
import java.lang.reflect.Type; |
|
import java.util.Set; |
|
|
|
|
|
public abstract class ElementAuthorityChecker<T> { |
|
|
|
|
|
/** |
|
* @Description 获取越权的数据连接 |
|
* @param: t 待检查的对象 |
|
* @param: authConnectionNames 有权限的数据连接名 |
|
* @return 如果有返回名称,没有返回null |
|
*/ |
|
@Nullable |
|
Set<String> getNoAuthConnectionNames(T t, Set<String> authConnectionNames) { |
|
return null; |
|
} |
|
|
|
|
|
/** |
|
* @Description 获取越权的服务器数据集 |
|
* @param: t 待检查的对象 |
|
* @param: authDatasetNames 有权限的服务器数据集名 |
|
* @return 如果有返回名称,没有返回null |
|
*/ |
|
@Nullable |
|
Set<String> getNoAuthDatasetNames(T t, Set<String> authDatasetNames) { |
|
return null; |
|
} |
|
|
|
/** |
|
* @Description 要检查对象的className |
|
* @return className |
|
*/ |
|
String getCheckClassName() { |
|
ParameterizedTypeImpl parameterizedType = (ParameterizedTypeImpl) this.getClass().getGenericSuperclass(); |
|
Type type = parameterizedType.getActualTypeArguments()[0]; |
|
return type.getTypeName(); |
|
} |
|
} |