mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-08 12:39:05 +08:00
feat(data): 支持通过参数跳过数据权限
用法: DataScope dataScope = new DataScope(); dataScope.setSkip(true); baseMapper.selectPageByScope(page, wrapper, dataScope);
This commit is contained in:
1 parent
31f41db931
commit
cc0f1cda67
2 files changed
+10
No files matched your search
+5
@@ -32,6 +32,11 @@ import java.util.List;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DataScope extends HashMap {
|
||||
|
||||
/**
|
||||
* 跳过数据权限,直接在参数设置 skip
|
||||
*/
|
||||
private boolean skip = false;
|
||||
|
||||
/**
|
||||
* 限制范围的字段名称
|
||||
*/
|
||||
|
||||
+5
@@ -37,6 +37,11 @@ public class DataScopeInnerInterceptor implements DataScopeInterceptor {
|
||||
return;
|
||||
}
|
||||
|
||||
// 是否强制跳过数据权限
|
||||
if (dataScope.isSkip()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 返回true 不拦截直接返回原始 SQL (只针对 * 查询)
|
||||
if (DataScopeFuncEnum.ALL.equals(dataScope.getFunc()) && dataScopeHandle.calcScope(dataScope)) {
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user