Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-auth
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
base_platform_enterprise
gic-platform-auth
Commits
210e97f3
Commit
210e97f3
authored
Mar 31, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
普通管理员(非超级管理员)查询所拥有的应用权限
parent
f1d36ae9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
MenuApiService.java
...pi/src/main/java/com/gic/auth/service/MenuApiService.java
+11
-0
MenuApiServiceImpl.java
...a/com/gic/auth/service/outer/impl/MenuApiServiceImpl.java
+21
-0
No files found.
gic-platform-auth-api/src/main/java/com/gic/auth/service/MenuApiService.java
View file @
210e97f3
...
...
@@ -10,6 +10,7 @@ import com.gic.auth.qo.MenuOperationItemListQO;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
/**
* 权限树
...
...
@@ -32,6 +33,16 @@ public interface MenuApiService {
ServiceResponse
<
List
<
MenuDTO
>>
listByParentMenuIdList
(
List
<
Integer
>
parentMenuIdList
);
/**
* 普通管理员(非超级管理员)查询所拥有的应用权限
* @Title: getAppIdSetByUserId
* @Description:
* @author guojuxing
* @param userId
* @return com.gic.api.base.commons.ServiceResponse<java.util.Set<java.lang.String>> 应用ID集合
*/
ServiceResponse
<
Set
<
String
>>
getAppIdSetByUserId
(
Integer
userId
);
/**
* 查询用户拥有的所有菜单路由权限,用于登录用户session用
* @Title: listUserMenu
* @Description:
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/MenuApiServiceImpl.java
View file @
210e97f3
...
...
@@ -74,6 +74,27 @@ public class MenuApiServiceImpl implements MenuApiService {
}
@Override
public
ServiceResponse
<
Set
<
String
>>
getAppIdSetByUserId
(
Integer
userId
)
{
TabSysUser
tabSysUser
=
userService
.
getUserById
(
userId
);
if
(
tabSysUser
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"用户不存在"
);
}
if
(
tabSysUser
.
getSuperAdmin
().
intValue
()
==
1
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"超级管理员拥有全部"
);
}
List
<
TabSysMenu
>
menuList
=
getUserMenuList
(
userId
);
Set
<
String
>
resultSet
=
new
HashSet
<>();
if
(
CollectionUtils
.
isNotEmpty
(
menuList
))
{
for
(
TabSysMenu
record
:
menuList
)
{
if
(
record
.
getLevel
().
intValue
()
==
1
)
{
resultSet
.
add
(
record
.
getProject
());
}
}
}
return
ServiceResponse
.
success
(
resultSet
);
}
@Override
public
ServiceResponse
<
List
<
MenuDTO
>>
listUserMenu
(
Integer
userId
,
String
versionCode
)
{
TabSysUser
tabSysUser
=
userService
.
getUserById
(
userId
);
if
(
tabSysUser
==
null
)
{
...
...
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