Explorar el Código

增加url 权限403 时打印日志

wuchangfu hace 7 meses
padre
commit
6a2694270a

+ 2 - 2
superdesk-libs-mybatis/src/main/java/cn/superdesk/libs/mybatis/datasource/MutiRouteDataSource.java

@@ -172,8 +172,8 @@ public class MutiRouteDataSource extends AbstractDataSource implements Applicati
             String     dsKey     = iter.next(); //
             Properties nodeProps = mapCustom.get(dsKey);
             // 如果当前库为最新一组数据库,注册beanName为master
-            logger.info(">>>>>begin to initialize datasource:" + dsKey + "\n================\n" + nodeProps.toString()
-                    + "\n==============");
+            //logger.info(">>>>>begin to initialize datasource:" + dsKey + "\n================\n" + nodeProps.toString()
+            //        + "\n==============");
             if (DataSourceType.Druid == dataSourceType) {
                 beanDefinitionBuilder = DruidDataSourceBuilder.builder(nodeProps);
             } else if (DataSourceType.HikariCP == dataSourceType) {

+ 2 - 0
superdesk-libs-security/src/main/java/cn/superdesk/libs/security/SecurityDelegating.java

@@ -2,6 +2,7 @@ package cn.superdesk.libs.security;
 
 import java.io.Serializable;
 
+import cn.superdesk.libs.common.json.JsonUtils;
 import cn.superdesk.libs.security.model.BaseUserInfo;
 import cn.superdesk.libs.security.model.UserSession;
 import org.apache.commons.lang3.StringUtils;
@@ -96,6 +97,7 @@ public class SecurityDelegating {
             // 403
             if (StringUtils.isNotBlank(permssionCode)
                     && !getInstance().resourceManager.getUserPermissionCodes(session.getUserId()).contains(permssionCode)) {
+                logger.info("doAuthorization 403 $permssionCode:{} userUrls:{}", permssionCode, JsonUtils.toJson(getInstance().resourceManager.getUserPermissionCodes(session.getUserId())) );
                 throw new ForbiddenAccessException();
             }
         }