Commit 60ce941b authored by zjy's avatar zjy

user/role/tright 7.26

parent 948279b4
......@@ -58,6 +58,8 @@ public class RoleServiceImpl implements RoleService {
List<String> authorityIds = webRoleReqVo.getAuthorityIds();
if (authorityIds != null && !authorityIds.isEmpty()){
for (String authorityId : authorityIds) {
/*查看该权限是否有上级权限*/
findParent(authorityId,webRoleReqVo.getId());
RoleAuthorityVo roleAuthorityRelation = new RoleAuthorityVo();
roleAuthorityRelation.setAuthorityId(authorityId);
roleAuthorityRelation.setRoleId(webRoleReqVo.getId());
......@@ -68,6 +70,24 @@ public class RoleServiceImpl implements RoleService {
return roleVo.getId();
}
private void findParent(String authorityId,String roleId){
AuthorityGetReqVo authorityGetReqVo = new AuthorityGetReqVo();
authorityGetReqVo.setId(authorityId);
AuthorityVo authorityVo = authorityDaoImpl.load(authorityGetReqVo,AuthorityVo.class);
if (null != authorityVo.getPid() && !authorityVo.getPid().isEmpty()){
String authorityPid = authorityVo.getPid();
RoleAuthorityVo roleAuthorityVo = new RoleAuthorityVo();
roleAuthorityVo.setAuthorityId(authorityPid);
roleAuthorityVo.setRoleId(roleId);
RoleAuthorityVo roleAuthorityVo1 = roleAuthorityDaoImpl.load(roleAuthorityVo,RoleAuthorityVo.class);
if (null == roleAuthorityVo1){
roleAuthorityVo.setId(StringHelper.getNewID());
roleAuthorityDaoImpl.create(roleAuthorityVo);
findParent(authorityPid,roleId);
}
}
}
/**
* 更新RoleVo对象,并更新角色权限的对应关系
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment