Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cash-loan-flow-boss
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QG
cash-loan-flow-boss
Commits
5ca63ea6
Commit
5ca63ea6
authored
Sep 18, 2019
by
suntao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qian xian
parent
c8ce9cab
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
ApplicationSecurityHandler.java
...owboss/core/configuration/ApplicationSecurityHandler.java
+10
-4
No files found.
src/main/java/cn/quantgroup/cashloanflowboss/core/configuration/ApplicationSecurityHandler.java
View file @
5ca63ea6
...
@@ -32,19 +32,25 @@ public class ApplicationSecurityHandler implements SecurityHandler {
...
@@ -32,19 +32,25 @@ public class ApplicationSecurityHandler implements SecurityHandler {
Assert
.
isNull
(
principal
,
ApplicationStatus
.
AUTHENTICATION_FAILURE
);
Assert
.
isNull
(
principal
,
ApplicationStatus
.
AUTHENTICATION_FAILURE
);
// 如果是超级管理员跳过权限验证
// 如果是超级管理员跳过权限验证
boolean
superAdministrator
=
principal
.
isSuperAdministrator
();
boolean
anyMatch
=
principal
.
getRoles
().
stream
().
anyMatch
(
role
->
{
return
principal
.
isSuperAdministrator
()
||
principal
.
getRoles
().
stream
().
anyMatch
(
role
->
{
List
<
Role
>
roleList
=
getRoleAndParent
(
role
);
List
<
Role
>
roleList
=
getRoleAndParent
(
role
);
if
(
CollectionUtils
.
isEmpty
(
roleList
))
{
return
false
;
}
return
roleList
.
stream
().
anyMatch
(
_role
->
this
.
checkAuthority
(
authorityId
,
_role
));
return
roleList
.
stream
().
anyMatch
(
_role
->
this
.
checkAuthority
(
authorityId
,
_role
));
});
});
return
superAdministrator
||
anyMatch
;
}
}
/**
* 遍历出用户的父级 role
* @param role
* @return
*/
private
List
<
Role
>
getRoleAndParent
(
Role
role
)
{
private
List
<
Role
>
getRoleAndParent
(
Role
role
)
{
if
(
role
==
null
)
{
if
(
role
==
null
)
{
return
n
ew
ArrayList
<>()
;
return
n
ull
;
}
}
List
<
Role
>
list
=
new
ArrayList
<>();
List
<
Role
>
list
=
new
ArrayList
<>();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment