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
fe356559
Commit
fe356559
authored
Dec 07, 2020
by
suntao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
忘记改的什么了
parent
71e430d3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
16 deletions
+12
-16
Principal.java
...uantgroup/cashloanflowboss/api/login/model/Principal.java
+1
-1
UserDetailInfo.java
...group/cashloanflowboss/api/user/model/UserDetailInfo.java
+6
-8
ApplicationSecurityHandler.java
...owboss/core/configuration/ApplicationSecurityHandler.java
+5
-7
No files found.
src/main/java/cn/quantgroup/cashloanflowboss/api/login/model/Principal.java
View file @
fe356559
...
...
@@ -33,7 +33,7 @@ public class Principal implements Serializable {
/**
* 角色列表
*/
private
List
<
Role
>
roles
;
private
Role
roles
;
/**
* 登录时间
...
...
src/main/java/cn/quantgroup/cashloanflowboss/api/user/model/UserDetailInfo.java
View file @
fe356559
...
...
@@ -34,18 +34,16 @@ public class UserDetailInfo {
Long
userId
=
principal
.
getUserInfo
().
getUserId
();
userDetailInfo
.
setRank
(
principal
.
getRank
().
name
());
userDetailInfo
.
setChannelId
(
principal
.
getChannelId
());
List
<
Role
>
roles
=
principal
.
getRoles
();
Role
role
=
principal
.
getRoles
();
if
(
null
!=
role
s
&&
roles
.
size
()
>
0
)
{
if
(
null
!=
role
)
{
RoleInfo
roleInfo
=
new
RoleInfo
();
List
<
RoleInfo
.
RoleView
>
roleInfos
=
Lists
.
newArrayList
();
roles
.
forEach
(
role
->
{
RoleInfo
.
RoleView
roleView
=
new
RoleInfo
.
RoleView
();
roleView
.
setRoleId
(
role
.
getId
());
roleView
.
setRoleName
(
role
.
getName
());
roleInfos
.
add
(
roleView
);
});
roleInfo
.
setRoleInfos
(
roleInfos
);
userDetailInfo
.
setRoleInfo
(
roleInfo
);
}
...
...
src/main/java/cn/quantgroup/cashloanflowboss/core/configuration/ApplicationSecurityHandler.java
View file @
fe356559
...
...
@@ -66,13 +66,11 @@ public class ApplicationSecurityHandler implements SecurityHandler {
// 如果是超级管理员跳过权限验证
boolean
hasPrivilege
=
principal
.
isSuperAdministrator
()
||
principal
.
getRoles
().
stream
().
anyMatch
(
role
->
{
List
<
Role
>
roleList
=
getRoleAndParent
(
role
);
if
(
CollectionUtils
.
isEmpty
(
roleList
))
{
return
false
;
}
return
roleList
.
stream
().
anyMatch
(
roleItem
->
this
.
checkAuthority
(
authorityId
,
roleItem
));
});
boolean
hasPrivilege
=
principal
.
isSuperAdministrator
();
List
<
Role
>
roleList
=
getRoleAndParent
(
principal
.
getRoles
());
hasPrivilege
&=
CollectionUtils
.
isEmpty
(
roleList
);
hasPrivilege
&=
roleList
.
stream
().
anyMatch
(
roleItem
->
this
.
checkAuthority
(
authorityId
,
roleItem
));
if
(
hasPrivilege
)
{
return
new
Tuple
<>(
Boolean
.
TRUE
,
null
);
}
else
{
...
...
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