use of com.diboot.iam.annotation.process.ApiPermission in project diboot by dibo-software.
the class IamCacheManager method initApiPermissionCache.
/**
* 初始化
*/
private static synchronized void initApiPermissionCache() {
StaticMemoryCacheManager cacheManager = getCacheManager();
if (cacheManager.isUninitializedCache(CACHE_NAME_CONTROLLER_API) == false) {
return;
}
List<ApiPermissionWrapper> permissions = ApiPermissionExtractor.extractAllApiPermissions();
if (V.notEmpty(permissions)) {
for (ApiPermissionWrapper wrapper : permissions) {
if (wrapper.getChildren() != null) {
for (ApiPermission apiPermission : wrapper.getChildren()) {
// 缓存url-permission
URL_PERMISSIONCODE_CACHE.put(apiPermission.getApiMethod().toUpperCase() + ":" + apiPermission.getApiUri(), apiPermission.getPermissionCode());
// 缓存class-api
cacheManager.putCacheObj(CACHE_NAME_CONTROLLER_API, wrapper.getClassName(), wrapper);
}
}
}
}
}
Aggregations