Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yujianwangzivayy
MaxKey
提交
0dd0dba1
MaxKey
项目概览
yujianwangzivayy
/
MaxKey
与 Fork 源项目一致
Fork自
MaxKey单点登录官方(MaxKeyTop) / MaxKey
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
MaxKey
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0dd0dba1
编写于
4月 03, 2022
作者:
M
MaxKey
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify
上级
0586a2a5
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
88 addition
and
90 deletion
+88
-90
maxkey-core/src/main/java/org/maxkey/entity/RolePrivileges.java
...-core/src/main/java/org/maxkey/entity/RolePrivileges.java
+6
-6
maxkey-persistence/src/main/java/org/maxkey/persistence/mapper/RolesMapper.java
.../main/java/org/maxkey/persistence/mapper/RolesMapper.java
+4
-4
maxkey-persistence/src/main/java/org/maxkey/persistence/service/RolesService.java
...ain/java/org/maxkey/persistence/service/RolesService.java
+7
-7
maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/mysql/RolesMapper.xml
...s/org/maxkey/persistence/mapper/xml/mysql/RolesMapper.xml
+6
-6
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/permissions/contorller/RoleMemberController.java
...xkey/web/permissions/contorller/RoleMemberController.java
+7
-7
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/permissions/contorller/RolePrivilegesController.java
.../web/permissions/contorller/RolePrivilegesController.java
+58
-60
未找到文件。
maxkey-core/src/main/java/org/maxkey/entity/RoleP
ermission
s.java
→
maxkey-core/src/main/java/org/maxkey/entity/RoleP
rivilege
s.java
浏览文件 @
0dd0dba1
...
@@ -29,8 +29,8 @@ import org.maxkey.constants.ConstsStatus;
...
@@ -29,8 +29,8 @@ import org.maxkey.constants.ConstsStatus;
import
org.maxkey.web.WebContext
;
import
org.maxkey.web.WebContext
;
@Entity
@Entity
@Table
(
name
=
"MXK_ROLE_P
ERMISSION
S"
)
@Table
(
name
=
"MXK_ROLE_P
RIVILEGE
S"
)
public
class
RoleP
ermission
s
extends
JpaBaseEntity
implements
Serializable
{
public
class
RoleP
rivilege
s
extends
JpaBaseEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
8783585691243853899L
;
private
static
final
long
serialVersionUID
=
-
8783585691243853899L
;
@Id
@Id
...
@@ -50,10 +50,10 @@ public class RolePermissions extends JpaBaseEntity implements Serializable {
...
@@ -50,10 +50,10 @@ public class RolePermissions extends JpaBaseEntity implements Serializable {
private
String
instName
;
private
String
instName
;
public
RoleP
ermission
s
()
{
public
RoleP
rivilege
s
()
{
}
}
public
RoleP
ermission
s
(
String
appId
,
String
roleId
,
String
instId
)
{
public
RoleP
rivilege
s
(
String
appId
,
String
roleId
,
String
instId
)
{
this
.
appId
=
appId
;
this
.
appId
=
appId
;
this
.
roleId
=
roleId
;
this
.
roleId
=
roleId
;
this
.
instId
=
instId
;
this
.
instId
=
instId
;
...
@@ -65,7 +65,7 @@ public class RolePermissions extends JpaBaseEntity implements Serializable {
...
@@ -65,7 +65,7 @@ public class RolePermissions extends JpaBaseEntity implements Serializable {
* @param roleId String
* @param roleId String
* @param resourceId String
* @param resourceId String
*/
*/
public
RoleP
ermission
s
(
String
appId
,
String
roleId
,
String
resourceId
,
String
instId
)
{
public
RoleP
rivilege
s
(
String
appId
,
String
roleId
,
String
resourceId
,
String
instId
)
{
this
.
id
=
WebContext
.
genId
();
this
.
id
=
WebContext
.
genId
();
this
.
appId
=
appId
;
this
.
appId
=
appId
;
this
.
roleId
=
roleId
;
this
.
roleId
=
roleId
;
...
@@ -136,7 +136,7 @@ public class RolePermissions extends JpaBaseEntity implements Serializable {
...
@@ -136,7 +136,7 @@ public class RolePermissions extends JpaBaseEntity implements Serializable {
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
StringBuilder
builder
=
new
StringBuilder
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
append
(
"RoleP
ermission
s [id="
);
builder
.
append
(
"RoleP
rivilege
s [id="
);
builder
.
append
(
id
);
builder
.
append
(
id
);
builder
.
append
(
", appId="
);
builder
.
append
(
", appId="
);
builder
.
append
(
appId
);
builder
.
append
(
appId
);
...
...
maxkey-persistence/src/main/java/org/maxkey/persistence/mapper/RolesMapper.java
浏览文件 @
0dd0dba1
...
@@ -23,7 +23,7 @@ package org.maxkey.persistence.mapper;
...
@@ -23,7 +23,7 @@ package org.maxkey.persistence.mapper;
import
java.util.List
;
import
java.util.List
;
import
org.apache.mybatis.jpa.persistence.IJpaBaseMapper
;
import
org.apache.mybatis.jpa.persistence.IJpaBaseMapper
;
import
org.maxkey.entity.RoleP
ermission
s
;
import
org.maxkey.entity.RoleP
rivilege
s
;
import
org.maxkey.entity.Roles
;
import
org.maxkey.entity.Roles
;
/**
/**
...
@@ -33,11 +33,11 @@ import org.maxkey.entity.Roles;
...
@@ -33,11 +33,11 @@ import org.maxkey.entity.Roles;
public
interface
RolesMapper
extends
IJpaBaseMapper
<
Roles
>
{
public
interface
RolesMapper
extends
IJpaBaseMapper
<
Roles
>
{
public
int
insertRoleP
ermissions
(
List
<
RolePermission
s
>
rolePermissionsList
);
public
int
insertRoleP
rivileges
(
List
<
RolePrivilege
s
>
rolePermissionsList
);
public
int
logisticDeleteRolePermissions
(
List
<
RolePermission
s
>
rolePermissionsList
);
public
int
deleteRolePrivileges
(
List
<
RolePrivilege
s
>
rolePermissionsList
);
public
List
<
RoleP
ermissions
>
queryRolePermissions
(
RolePermission
s
rolePermissions
);
public
List
<
RoleP
rivileges
>
queryRolePrivileges
(
RolePrivilege
s
rolePermissions
);
public
List
<
Roles
>
queryDynamicRoles
(
Roles
role
);
public
List
<
Roles
>
queryDynamicRoles
(
Roles
role
);
}
}
maxkey-persistence/src/main/java/org/maxkey/persistence/service/RolesService.java
浏览文件 @
0dd0dba1
...
@@ -20,7 +20,7 @@ package org.maxkey.persistence.service;
...
@@ -20,7 +20,7 @@ package org.maxkey.persistence.service;
import
java.util.List
;
import
java.util.List
;
import
org.apache.mybatis.jpa.persistence.JpaBaseService
;
import
org.apache.mybatis.jpa.persistence.JpaBaseService
;
import
org.maxkey.entity.RoleP
ermission
s
;
import
org.maxkey.entity.RoleP
rivilege
s
;
import
org.maxkey.entity.Roles
;
import
org.maxkey.entity.Roles
;
import
org.maxkey.persistence.mapper.RolesMapper
;
import
org.maxkey.persistence.mapper.RolesMapper
;
import
org.maxkey.util.StringUtils
;
import
org.maxkey.util.StringUtils
;
...
@@ -50,16 +50,16 @@ public class RolesService extends JpaBaseService<Roles>{
...
@@ -50,16 +50,16 @@ public class RolesService extends JpaBaseService<Roles>{
return
(
RolesMapper
)
super
.
getMapper
();
return
(
RolesMapper
)
super
.
getMapper
();
}
}
public
boolean
insertRoleP
ermissions
(
List
<
RolePermission
s
>
rolePermissionsList
)
{
public
boolean
insertRoleP
rivileges
(
List
<
RolePrivilege
s
>
rolePermissionsList
)
{
return
getMapper
().
insertRoleP
ermission
s
(
rolePermissionsList
)>
0
;
return
getMapper
().
insertRoleP
rivilege
s
(
rolePermissionsList
)>
0
;
};
};
public
boolean
logisticDeleteRolePermissions
(
List
<
RolePermission
s
>
rolePermissionsList
)
{
public
boolean
deleteRolePrivileges
(
List
<
RolePrivilege
s
>
rolePermissionsList
)
{
return
getMapper
().
logisticDeleteRolePermission
s
(
rolePermissionsList
)>=
0
;
return
getMapper
().
deleteRolePrivilege
s
(
rolePermissionsList
)>=
0
;
}
}
public
List
<
RoleP
ermissions
>
queryRolePermissions
(
RolePermission
s
rolePermissions
){
public
List
<
RoleP
rivileges
>
queryRolePrivileges
(
RolePrivilege
s
rolePermissions
){
return
getMapper
().
queryRoleP
ermission
s
(
rolePermissions
);
return
getMapper
().
queryRoleP
rivilege
s
(
rolePermissions
);
}
}
public
List
<
Roles
>
queryDynamicRoles
(
Roles
dynamicRole
){
public
List
<
Roles
>
queryDynamicRoles
(
Roles
dynamicRole
){
...
...
maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/mysql/RolesMapper.xml
浏览文件 @
0dd0dba1
...
@@ -56,11 +56,11 @@
...
@@ -56,11 +56,11 @@
</update>
</update>
<select
id=
"queryRoleP
ermissions"
parameterType=
"RolePermissions"
resultType=
"RolePermission
s"
>
<select
id=
"queryRoleP
rivileges"
parameterType=
"RolePrivileges"
resultType=
"RolePrivilege
s"
>
select
select
*
*
from
from
mxk_role_p
ermission
s
mxk_role_p
rivilege
s
where instid = #{instId}
where instid = #{instId}
and status = 1
and status = 1
<if
test=
"id != null and id != ''"
>
<if
test=
"id != null and id != ''"
>
...
@@ -75,8 +75,8 @@
...
@@ -75,8 +75,8 @@
</select>
</select>
<update
id=
"
logisticDeleteRolePermission
s"
parameterType=
"java.util.List"
>
<update
id=
"
deleteRolePrivilege
s"
parameterType=
"java.util.List"
>
update mxk_role_p
ermission
s
update mxk_role_p
rivilege
s
set status = 9
set status = 9
where 1 = 1 and
where 1 = 1 and
<foreach
item=
"item"
collection=
"list"
open=
"("
separator=
"or"
close=
")"
>
<foreach
item=
"item"
collection=
"list"
open=
"("
separator=
"or"
close=
")"
>
...
@@ -84,8 +84,8 @@
...
@@ -84,8 +84,8 @@
</foreach>
</foreach>
</update>
</update>
<insert
id=
"insertRoleP
ermission
s"
parameterType=
"java.util.List"
>
<insert
id=
"insertRoleP
rivilege
s"
parameterType=
"java.util.List"
>
insert into mxk_role_p
ermission
s ( id,appid,roleid,resourceid,status,instid)
insert into mxk_role_p
rivilege
s ( id,appid,roleid,resourceid,status,instid)
values
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(#{item.id},#{item.appId},#{item.roleId},#{item.resourceId},#{item.status},#{item.instId})
(#{item.id},#{item.appId},#{item.roleId},#{item.resourceId},#{item.status},#{item.instId})
...
...
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/permissions/contorller/RoleMemberController.java
浏览文件 @
0dd0dba1
...
@@ -63,9 +63,9 @@ public class RoleMemberController {
...
@@ -63,9 +63,9 @@ public class RoleMemberController {
@RequestMapping
(
value
=
{
"/memberInRole"
})
@RequestMapping
(
value
=
{
"/memberInRole"
})
@ResponseBody
@ResponseBody
public
ResponseEntity
<?>
memberInRole
(
@ModelAttribute
RoleMember
roleMember
)
{
public
ResponseEntity
<?>
memberInRole
(
@ModelAttribute
RoleMember
roleMember
,
@CurrentUser
UserInfo
currentUser
)
{
_logger
.
debug
(
"roleMember : "
+
roleMember
);
_logger
.
debug
(
"roleMember : "
+
roleMember
);
roleMember
.
setInstId
(
WebContext
.
getUserInfo
()
.
getInstId
());
roleMember
.
setInstId
(
currentUser
.
getInstId
());
if
(
roleMember
.
getRoleId
()==
null
||
roleMember
.
getRoleId
().
equals
(
""
)||
roleMember
.
getRoleId
().
equals
(
"ALL_USER_ROLE"
)){
if
(
roleMember
.
getRoleId
()==
null
||
roleMember
.
getRoleId
().
equals
(
""
)||
roleMember
.
getRoleId
().
equals
(
"ALL_USER_ROLE"
)){
return
new
Message
<
JpaPageResults
<
RoleMember
>>(
return
new
Message
<
JpaPageResults
<
RoleMember
>>(
roleMemberService
.
queryPageResults
(
"allMemberInRole"
,
roleMember
)).
buildResponse
();
roleMemberService
.
queryPageResults
(
"allMemberInRole"
,
roleMember
)).
buildResponse
();
...
@@ -77,15 +77,15 @@ public class RoleMemberController {
...
@@ -77,15 +77,15 @@ public class RoleMemberController {
@RequestMapping
(
value
=
{
"/memberNotInRole"
})
@RequestMapping
(
value
=
{
"/memberNotInRole"
})
@ResponseBody
@ResponseBody
public
ResponseEntity
<?>
memberNotInRole
(
@ModelAttribute
RoleMember
roleMember
)
{
public
ResponseEntity
<?>
memberNotInRole
(
@ModelAttribute
RoleMember
roleMember
,
@CurrentUser
UserInfo
currentUser
)
{
roleMember
.
setInstId
(
WebContext
.
getUserInfo
()
.
getInstId
());
roleMember
.
setInstId
(
currentUser
.
getInstId
());
return
new
Message
<
JpaPageResults
<
RoleMember
>>(
return
new
Message
<
JpaPageResults
<
RoleMember
>>(
roleMemberService
.
queryPageResults
(
"memberNotIn
Group
"
,
roleMember
)).
buildResponse
();
roleMemberService
.
queryPageResults
(
"memberNotIn
Role
"
,
roleMember
)).
buildResponse
();
}
}
@RequestMapping
(
value
=
{
"/add"
})
@RequestMapping
(
value
=
{
"/add"
})
@ResponseBody
@ResponseBody
public
ResponseEntity
<?>
add
(
@ModelAttribute
RoleMember
roleMember
)
{
public
ResponseEntity
<?>
add
(
@ModelAttribute
RoleMember
roleMember
,
@CurrentUser
UserInfo
currentUser
)
{
if
(
roleMember
==
null
||
roleMember
.
getRoleId
()
==
null
)
{
if
(
roleMember
==
null
||
roleMember
.
getRoleId
()
==
null
)
{
return
new
Message
<
RoleMember
>(
Message
.
FAIL
).
buildResponse
();
return
new
Message
<
RoleMember
>(
Message
.
FAIL
).
buildResponse
();
}
}
...
@@ -106,7 +106,7 @@ public class RoleMemberController {
...
@@ -106,7 +106,7 @@ public class RoleMemberController {
arrMemberIds
[
i
],
arrMemberIds
[
i
],
arrMemberNames
[
i
],
arrMemberNames
[
i
],
"USER"
,
"USER"
,
WebContext
.
getUserInfo
()
.
getInstId
());
currentUser
.
getInstId
());
newRoleMember
.
setId
(
WebContext
.
genId
());
newRoleMember
.
setId
(
WebContext
.
genId
());
result
=
roleMemberService
.
insert
(
newRoleMember
);
result
=
roleMemberService
.
insert
(
newRoleMember
);
}
}
...
...
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/permissions/contorller/RolePrivilegesController.java
浏览文件 @
0dd0dba1
...
@@ -21,22 +21,22 @@ import java.util.ArrayList;
...
@@ -21,22 +21,22 @@ import java.util.ArrayList;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
org.maxkey.constants.ConstsOperateMessage
;
import
org.maxkey.authn.annotation.CurrentUser
;
import
org.maxkey.entity.RolePermissions
;
import
org.maxkey.entity.Message
;
import
org.maxkey.entity.RolePrivileges
;
import
org.maxkey.entity.UserInfo
;
import
org.maxkey.persistence.service.RolesService
;
import
org.maxkey.persistence.service.RolesService
;
import
org.maxkey.util.StringUtils
;
import
org.maxkey.util.StringUtils
;
import
org.maxkey.web.WebContext
;
import
org.maxkey.web.message.Message
;
import
org.maxkey.web.message.MessageType
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.servlet.ModelAndView
;
@Controller
@Controller
...
@@ -47,85 +47,83 @@ public class RolePrivilegesController {
...
@@ -47,85 +47,83 @@ public class RolePrivilegesController {
@Autowired
@Autowired
@Qualifier
(
"rolesService"
)
@Qualifier
(
"rolesService"
)
RolesService
rolesService
;
RolesService
rolesService
;
@RequestMapping
(
value
={
"/list"
})
public
ModelAndView
resourcesList
(){
return
new
ModelAndView
(
"permissions/permissionsList"
);
}
@ResponseBody
@ResponseBody
@RequestMapping
(
value
={
"/savepermissions"
})
@RequestMapping
(
value
={
"/update"
},
produces
=
{
MediaType
.
APPLICATION_JSON_VALUE
})
public
Message
insert
(
@ModelAttribute
(
"rolePermissions"
)
RolePermissions
rolePermissions
)
{
public
ResponseEntity
<?>
update
(
_logger
.
debug
(
"-save :"
+
rolePermissions
);
@ModelAttribute
RolePrivileges
rolePrivileges
,
@CurrentUser
UserInfo
currentUser
)
{
_logger
.
debug
(
"-update : "
+
rolePrivileges
);
//have
//have
String
instId
=
WebContext
.
getUserInfo
().
getInstId
();
RolePrivileges
queryRolePrivileges
=
RolePermissions
queryRolePermissions
=
new
RolePrivileges
(
new
RolePermissions
(
rolePrivileges
.
getAppId
(),
rolePermissions
.
getAppId
(),
rolePrivileges
.
getRoleId
(),
rolePermissions
.
getRoleId
(),
currentUser
.
getInstId
());
instId
);
List
<
RolePrivileges
>
roleRolePrivilegesList
=
rolesService
.
queryRolePrivileges
(
queryRolePrivileges
);
List
<
RolePermissions
>
rolePermissionsedList
=
rolesService
.
queryRolePermissions
(
queryRolePermissions
);
HashMap
<
String
,
String
>
p
ermed
Map
=
new
HashMap
<
String
,
String
>();
HashMap
<
String
,
String
>
p
rivilege
Map
=
new
HashMap
<
String
,
String
>();
for
(
RoleP
ermissions
rolePerms
:
rolePermissionsed
List
)
{
for
(
RoleP
rivileges
rolePrivilege
:
roleRolePrivileges
List
)
{
permedMap
.
put
(
rolePerms
.
getUniqueId
(),
rolePerms
.
getId
());
privilegeMap
.
put
(
rolePrivilege
.
getUniqueId
(),
rolePrivilege
.
getId
());
}
}
//Maybe insert
//Maybe insert
ArrayList
<
RoleP
ermissions
>
rolePermissionsList
=
new
ArrayList
<
RolePermission
s
>();
ArrayList
<
RoleP
rivileges
>
newRolePrivilegesList
=
new
ArrayList
<
RolePrivilege
s
>();
List
<
String
>
resourceIds
=
StringUtils
.
string2List
(
roleP
ermission
s
.
getResourceId
(),
","
);
List
<
String
>
resourceIds
=
StringUtils
.
string2List
(
roleP
rivilege
s
.
getResourceId
(),
","
);
HashMap
<
String
,
String
>
newP
erm
sMap
=
new
HashMap
<
String
,
String
>();
HashMap
<
String
,
String
>
newP
rivilege
sMap
=
new
HashMap
<
String
,
String
>();
for
(
String
resourceId
:
resourceIds
)
{
for
(
String
resourceId
:
resourceIds
)
{
RolePrivileges
newRolePrivilege
=
new
RolePrivileges
(
RolePermissions
newRolePermissions
=
new
RolePermissions
(
rolePrivileges
.
getAppId
(),
rolePermissions
.
getAppId
(),
rolePrivileges
.
getRoleId
(),
rolePermissions
.
getRoleId
(),
resourceId
,
resourceId
,
instId
);
currentUser
.
getInstId
()
);
newRoleP
ermissions
.
setId
(
newRolePermissions
.
generateId
());
newRoleP
rivilege
.
setId
(
newRolePrivilege
.
generateId
());
newP
ermsMap
.
put
(
newRolePermissions
.
getUniqueId
(),
rolePermission
s
.
getAppId
());
newP
rivilegesMap
.
put
(
newRolePrivilege
.
getUniqueId
(),
rolePrivilege
s
.
getAppId
());
if
(!
roleP
ermission
s
.
getAppId
().
equalsIgnoreCase
(
resourceId
)
&&
if
(!
roleP
rivilege
s
.
getAppId
().
equalsIgnoreCase
(
resourceId
)
&&
!
p
ermedMap
.
containsKey
(
newRolePermissions
.
getUniqueId
()))
{
!
p
rivilegeMap
.
containsKey
(
newRolePrivilege
.
getUniqueId
()))
{
rolePermissionsList
.
add
(
newRolePermissions
);
newRolePrivilegesList
.
add
(
newRolePrivilege
);
}
}
}
}
//delete
//delete
ArrayList
<
RoleP
ermissions
>
deleteRolePermissionsList
=
new
ArrayList
<
RolePermission
s
>();
ArrayList
<
RoleP
rivileges
>
deleteRolePrivilegesList
=
new
ArrayList
<
RolePrivilege
s
>();
for
(
RoleP
ermissions
rolePerms
:
rolePermissionsed
List
)
{
for
(
RoleP
rivileges
rolePrivilege
:
roleRolePrivileges
List
)
{
if
(!
newP
ermsMap
.
containsKey
(
rolePerms
.
getUniqueId
()))
{
if
(!
newP
rivilegesMap
.
containsKey
(
rolePrivilege
.
getUniqueId
()))
{
roleP
erms
.
setInstId
(
instId
);
roleP
rivilege
.
setInstId
(
currentUser
.
getInstId
()
);
deleteRolePermissionsList
.
add
(
rolePerms
);
deleteRolePrivilegesList
.
add
(
rolePrivilege
);
}
}
}
}
if
(!
deleteRolePermissionsList
.
isEmpty
())
{
if
(!
deleteRolePrivilegesList
.
isEmpty
())
{
rolesService
.
logisticDeleteRolePermissions
(
deleteRolePermissionsList
);
_logger
.
debug
(
"-remove : "
+
deleteRolePrivilegesList
);
rolesService
.
deleteRolePrivileges
(
deleteRolePrivilegesList
);
}
}
if
(!
rolePermissionsList
.
isEmpty
()
&&
rolesService
.
insertRolePermissions
(
rolePermissionsList
))
{
if
(!
newRolePrivilegesList
.
isEmpty
()
&&
rolesService
.
insertRolePrivileges
(
newRolePrivilegesList
))
{
return
new
Message
(
WebContext
.
getI18nValue
(
ConstsOperateMessage
.
INSERT_SUCCESS
),
MessageType
.
success
);
_logger
.
debug
(
"-insert : "
+
newRolePrivilegesList
);
return
new
Message
<
RolePrivileges
>(
Message
.
SUCCESS
).
buildResponse
();
}
else
{
}
else
{
return
new
Message
(
WebContext
.
getI18nValue
(
ConstsOperateMessage
.
INSERT_SUCCESS
),
MessageType
.
error
);
return
new
Message
<
RolePrivileges
>(
Message
.
SUCCESS
).
buildResponse
(
);
}
}
}
}
@ResponseBody
@ResponseBody
@RequestMapping
(
value
={
"/querypermissions"
})
@RequestMapping
(
value
={
"/get"
},
produces
=
{
MediaType
.
APPLICATION_JSON_VALUE
})
public
List
<
RolePermissions
>
querypermissions
(
@ModelAttribute
(
"rolePermissions"
)
RolePermissions
rolePermissions
)
{
public
ResponseEntity
<?>
get
(
_logger
.
debug
(
"-querypermissions :"
+
rolePermissions
);
@ModelAttribute
RolePrivileges
rolePrivileges
,
@CurrentUser
UserInfo
currentUser
)
{
_logger
.
debug
(
"-get :"
+
rolePrivileges
);
//have
//have
RolePermissions
queryRolePermissions
=
RolePrivileges
queryRolePrivilege
=
new
RolePermissions
(
new
RolePrivileges
(
rolePermissions
.
getAppId
(),
rolePrivileges
.
getAppId
(),
rolePermissions
.
getRoleId
(),
rolePrivileges
.
getRoleId
(),
WebContext
.
getUserInfo
().
getInstId
());
currentUser
.
getInstId
());
List
<
RolePermissions
>
rolePermissionsedList
=
rolesService
.
queryRolePermissions
(
queryRolePermissions
);
List
<
RolePrivileges
>
rolePrivilegeList
=
rolesService
.
queryRolePrivileges
(
queryRolePrivilege
);
return
rolePermissionsedList
;
return
new
Message
<
List
<
RolePrivileges
>>(
rolePrivilegeList
).
buildResponse
();
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录