Merge branch 'hotfix/20240807' into 'master'
Hotfix/20240807 See merge request universal/infrastructure/backend/tyr!116
This commit is contained in:
commit
b3341bfa38
@ -44,6 +44,12 @@ public class ListPermissionFromRoleGroupReq {
|
||||
/** 角色组ID **/
|
||||
private List<Long> roleGroupIds;
|
||||
|
||||
/**
|
||||
* 原接口使用方有的需要2,有的需要3,当时加这个出了问题,默认为3
|
||||
* 1-仅查当前code 2-对应code角色组及子级角色组 3-仅对应code角色组的子级
|
||||
*/
|
||||
private Integer categoryType;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
|
||||
@ -57,6 +57,11 @@ public class ListPermissionFromRoleGroupResp {
|
||||
*/
|
||||
private String roleName;
|
||||
|
||||
/**
|
||||
* 角色编码
|
||||
*/
|
||||
private String roleCode;
|
||||
|
||||
/**
|
||||
* 权限集ID
|
||||
*/
|
||||
|
||||
@ -1047,7 +1047,9 @@ public class TyrSaasAuthServiceImpl implements TyrSaasAuthService {
|
||||
@Override
|
||||
public List<ListPermissionFromRoleGroupResp> listAuthByResourceAndRoleGroup(ListPermissionFromRoleGroupReq listPermissionFromRoleGroupReq) {
|
||||
//确定角色group_id: code对应角色组及其下级
|
||||
List<SaasRoleGroup> groups = roleGroupService.listByCodes(Collections.singletonList(listPermissionFromRoleGroupReq.getCategoryCode()), 3);
|
||||
Integer categoryType = Optional.ofNullable(listPermissionFromRoleGroupReq.getCategoryType())
|
||||
.orElse(3);
|
||||
List<SaasRoleGroup> groups = roleGroupService.listByCodes(Collections.singletonList(listPermissionFromRoleGroupReq.getCategoryCode()), categoryType);
|
||||
if (CollectionUtil.isEmpty(groups)) {
|
||||
log.warn("no role group found for code :{}", listPermissionFromRoleGroupReq.getCategoryCode());
|
||||
return Collections.emptyList();
|
||||
|
||||
@ -118,6 +118,7 @@
|
||||
t1.code roleGroupCode,
|
||||
t3.id roleId,
|
||||
t3.name roleName,
|
||||
t3.role_code roleCode,
|
||||
t4.group_id permissionGroupId
|
||||
|
||||
FROM
|
||||
|
||||
Loading…
Reference in New Issue
Block a user