Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-auth-client
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c1bbbfce
authored
Mar 17, 2022
by
levphon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
共享数据拦截器
1 parent
fb0c68f6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
15 deletions
src/main/java/cn/com/glsx/auth/interceptor/DataOnlySharedInterceptor.java
src/main/java/cn/com/glsx/auth/interceptor/DataPermissionInterceptor.java
src/main/java/cn/com/glsx/auth/interceptor/DataPermitLinkInterceptor.java
src/main/java/cn/com/glsx/auth/interceptor/DataOnlySharedInterceptor.java
View file @
c1bbbfc
...
@@ -82,17 +82,17 @@ public class DataOnlySharedInterceptor implements Interceptor {
...
@@ -82,17 +82,17 @@ public class DataOnlySharedInterceptor implements Interceptor {
return
invocation
.
proceed
();
return
invocation
.
proceed
();
}
}
//超级管理员/全部数据权限 不控制数据权限
if
(
ShieldContextHolder
.
isSuperAdmin
()
||
UserConstants
.
RolePermitCastType
.
all
.
getCode
().
equals
(
ShieldContextHolder
.
getRolePermissionType
()))
{
return
invocation
.
proceed
();
}
//没自定义注解直接按通过
//没自定义注解直接按通过
DataOnlyShared
dataAuth
=
getAnnotation
(
mappedStatement
);
DataOnlyShared
dataAuth
=
getAnnotation
(
mappedStatement
);
if
(
dataAuth
==
null
)
{
if
(
dataAuth
==
null
)
{
return
invocation
.
proceed
();
return
invocation
.
proceed
();
}
}
//超级管理员/全部数据权限 不控制数据权限
if
(
ShieldContextHolder
.
isSuperAdmin
()
||
UserConstants
.
RolePermitCastType
.
all
.
getCode
().
equals
(
ShieldContextHolder
.
getRolePermissionType
()))
{
return
invocation
.
proceed
();
}
//拼装sql
//拼装sql
String
originSql
=
boundSql
.
getSql
();
//获取到当前需要被执行的SQL
String
originSql
=
boundSql
.
getSql
();
//获取到当前需要被执行的SQL
...
...
src/main/java/cn/com/glsx/auth/interceptor/DataPermissionInterceptor.java
View file @
c1bbbfc
...
@@ -76,11 +76,6 @@ public class DataPermissionInterceptor implements Interceptor {
...
@@ -76,11 +76,6 @@ public class DataPermissionInterceptor implements Interceptor {
return
invocation
.
proceed
();
return
invocation
.
proceed
();
}
}
//超级管理员/全部数据权限 不控制数据权限
if
(
ShieldContextHolder
.
isSuperAdmin
()
||
UserConstants
.
RolePermitCastType
.
all
.
getCode
().
equals
(
ShieldContextHolder
.
getRolePermissionType
()))
{
return
invocation
.
proceed
();
}
Method
method
=
getMapperExecutingMethod
(
mappedStatement
);
Method
method
=
getMapperExecutingMethod
(
mappedStatement
);
if
(
method
==
null
)
{
if
(
method
==
null
)
{
throw
new
Exception
(
"Mybatis拦截器执行异常"
);
throw
new
Exception
(
"Mybatis拦截器执行异常"
);
...
@@ -96,6 +91,11 @@ public class DataPermissionInterceptor implements Interceptor {
...
@@ -96,6 +91,11 @@ public class DataPermissionInterceptor implements Interceptor {
return
invocation
.
proceed
();
return
invocation
.
proceed
();
}
}
//超级管理员/全部数据权限 不控制数据权限
if
(
ShieldContextHolder
.
isSuperAdmin
()
||
UserConstants
.
RolePermitCastType
.
all
.
getCode
().
equals
(
ShieldContextHolder
.
getRolePermissionType
()))
{
return
invocation
.
proceed
();
}
DataPerm
dataAuth
=
method
.
getAnnotation
(
DataPerm
.
class
);
DataPerm
dataAuth
=
method
.
getAnnotation
(
DataPerm
.
class
);
//拼装sql
//拼装sql
...
...
src/main/java/cn/com/glsx/auth/interceptor/DataPermitLinkInterceptor.java
View file @
c1bbbfc
...
@@ -83,11 +83,6 @@ public class DataPermitLinkInterceptor implements Interceptor {
...
@@ -83,11 +83,6 @@ public class DataPermitLinkInterceptor implements Interceptor {
return
invocation
.
proceed
();
return
invocation
.
proceed
();
}
}
//超级管理员/全部数据权限 不控制数据权限
if
(
ShieldContextHolder
.
isSuperAdmin
()
||
UserConstants
.
RolePermitCastType
.
all
.
getCode
().
equals
(
ShieldContextHolder
.
getRolePermissionType
()))
{
return
invocation
.
proceed
();
}
Method
method
=
getMapperExecutingMethod
(
mappedStatement
);
Method
method
=
getMapperExecutingMethod
(
mappedStatement
);
if
(
method
==
null
)
{
if
(
method
==
null
)
{
throw
new
Exception
(
"Mybatis拦截器执行异常"
);
throw
new
Exception
(
"Mybatis拦截器执行异常"
);
...
@@ -103,6 +98,11 @@ public class DataPermitLinkInterceptor implements Interceptor {
...
@@ -103,6 +98,11 @@ public class DataPermitLinkInterceptor implements Interceptor {
return
invocation
.
proceed
();
return
invocation
.
proceed
();
}
}
//超级管理员/全部数据权限 不控制数据权限
if
(
ShieldContextHolder
.
isSuperAdmin
()
||
UserConstants
.
RolePermitCastType
.
all
.
getCode
().
equals
(
ShieldContextHolder
.
getRolePermissionType
()))
{
return
invocation
.
proceed
();
}
//没自定义注解直接按通过
//没自定义注解直接按通过
DataPermShare
dataAuth
=
method
.
getAnnotation
(
DataPermShare
.
class
);
DataPermShare
dataAuth
=
method
.
getAnnotation
(
DataPermShare
.
class
);
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment