|
|
@@ -59,12 +59,20 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IR
|
|
|
|
|
|
@Override
|
|
|
public List<RoleVO> tree(String tenantId) {
|
|
|
- String userRole = AuthUtil.getUserRole();
|
|
|
- String excludeRole = null;
|
|
|
- if (!CollectionUtil.contains(Func.toStrArray(userRole), RoleConstant.ADMIN) && !CollectionUtil.contains(Func.toStrArray(userRole), RoleConstant.ADMINISTRATOR)) {
|
|
|
- excludeRole = RoleConstant.ADMINISTRATOR;
|
|
|
+ if (AuthUtil.getUserRole().contains("dealer")) {
|
|
|
+ Role role = baseMapper.selectOne(new LambdaQueryWrapper<Role>()
|
|
|
+ .eq(Role::getTenantId,tenantId)
|
|
|
+ .eq(Role::getIsDeleted,0)
|
|
|
+ .eq(Role::getRoleAlias,"dealer"));
|
|
|
+ return ForestNodeMerger.merge(baseMapper.treeDealer(tenantId, role.getId()));
|
|
|
+ }else{
|
|
|
+ String userRole = AuthUtil.getUserRole();
|
|
|
+ String excludeRole = null;
|
|
|
+ if (!CollectionUtil.contains(Func.toStrArray(userRole), RoleConstant.ADMIN) && !CollectionUtil.contains(Func.toStrArray(userRole), RoleConstant.ADMINISTRATOR)) {
|
|
|
+ excludeRole = RoleConstant.ADMINISTRATOR;
|
|
|
+ }
|
|
|
+ return ForestNodeMerger.merge(baseMapper.tree(tenantId, excludeRole));
|
|
|
}
|
|
|
- return ForestNodeMerger.merge(baseMapper.tree(tenantId, excludeRole));
|
|
|
}
|
|
|
|
|
|
@Override
|