Commit c1bbbfce by levphon

共享数据拦截器

1 parent fb0c68f6
......@@ -82,17 +82,17 @@ public class DataOnlySharedInterceptor implements Interceptor {
return invocation.proceed();
}
//超级管理员/全部数据权限 不控制数据权限
if (ShieldContextHolder.isSuperAdmin() || UserConstants.RolePermitCastType.all.getCode().equals(ShieldContextHolder.getRolePermissionType())) {
return invocation.proceed();
}
//没自定义注解直接按通过
DataOnlyShared dataAuth = getAnnotation(mappedStatement);
if (dataAuth == null) {
return invocation.proceed();
}
//超级管理员/全部数据权限 不控制数据权限
if (ShieldContextHolder.isSuperAdmin() || UserConstants.RolePermitCastType.all.getCode().equals(ShieldContextHolder.getRolePermissionType())) {
return invocation.proceed();
}
//拼装sql
String originSql = boundSql.getSql(); //获取到当前需要被执行的SQL
......
......@@ -76,11 +76,6 @@ public class DataPermissionInterceptor implements Interceptor {
return invocation.proceed();
}
//超级管理员/全部数据权限 不控制数据权限
if (ShieldContextHolder.isSuperAdmin() || UserConstants.RolePermitCastType.all.getCode().equals(ShieldContextHolder.getRolePermissionType())) {
return invocation.proceed();
}
Method method = getMapperExecutingMethod(mappedStatement);
if (method == null) {
throw new Exception("Mybatis拦截器执行异常");
......@@ -96,6 +91,11 @@ public class DataPermissionInterceptor implements Interceptor {
return invocation.proceed();
}
//超级管理员/全部数据权限 不控制数据权限
if (ShieldContextHolder.isSuperAdmin() || UserConstants.RolePermitCastType.all.getCode().equals(ShieldContextHolder.getRolePermissionType())) {
return invocation.proceed();
}
DataPerm dataAuth = method.getAnnotation(DataPerm.class);
//拼装sql
......
......@@ -83,11 +83,6 @@ public class DataPermitLinkInterceptor implements Interceptor {
return invocation.proceed();
}
//超级管理员/全部数据权限 不控制数据权限
if (ShieldContextHolder.isSuperAdmin() || UserConstants.RolePermitCastType.all.getCode().equals(ShieldContextHolder.getRolePermissionType())) {
return invocation.proceed();
}
Method method = getMapperExecutingMethod(mappedStatement);
if (method == null) {
throw new Exception("Mybatis拦截器执行异常");
......@@ -103,6 +98,11 @@ public class DataPermitLinkInterceptor implements Interceptor {
return invocation.proceed();
}
//超级管理员/全部数据权限 不控制数据权限
if (ShieldContextHolder.isSuperAdmin() || UserConstants.RolePermitCastType.all.getCode().equals(ShieldContextHolder.getRolePermissionType())) {
return invocation.proceed();
}
//没自定义注解直接按通过
DataPermShare dataAuth = method.getAnnotation(DataPermShare.class);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!