ROLE_MANAGE role audit thread pool failed (#1166)

1.5.0
chen.ma 2 years ago
parent 73124de92e
commit e596b630cd

@ -20,12 +20,17 @@ package cn.hippo4j.config.service.biz.impl;
import cn.hippo4j.common.constant.ConfigModifyTypeConstants;
import cn.hippo4j.common.enums.DelEnum;
import cn.hippo4j.common.toolkit.BeanUtil;
import cn.hippo4j.common.toolkit.CollectionUtil;
import cn.hippo4j.common.toolkit.JSONUtil;
import cn.hippo4j.common.toolkit.UserContext;
import cn.hippo4j.config.mapper.ConfigInfoMapper;
import cn.hippo4j.config.model.ConfigAllInfo;
import cn.hippo4j.config.model.LogRecordInfo;
import cn.hippo4j.config.model.biz.threadpool.*;
import cn.hippo4j.config.model.biz.threadpool.ConfigModifySaveReqDTO;
import cn.hippo4j.config.model.biz.threadpool.ThreadPoolDelReqDTO;
import cn.hippo4j.config.model.biz.threadpool.ThreadPoolQueryReqDTO;
import cn.hippo4j.config.model.biz.threadpool.ThreadPoolRespDTO;
import cn.hippo4j.config.model.biz.threadpool.ThreadPoolSaveOrUpdateReqDTO;
import cn.hippo4j.config.service.biz.ConfigService;
import cn.hippo4j.config.service.biz.OperationLogService;
import cn.hippo4j.config.service.biz.ThreadPoolService;
@ -34,7 +39,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.Date;
@ -45,17 +50,16 @@ import java.util.Objects;
* Thread pool service impl.
*/
@Service
@AllArgsConstructor
@RequiredArgsConstructor
public class ThreadPoolServiceImpl implements ThreadPoolService {
private final ConfigService configService;
private final ConfigInfoMapper configInfoMapper;
private final OperationLogService operationLogService;
private final ConfigModificationVerifyServiceChoose configModificationVerifyServiceChoose;
private static final List<String> AUDITABLE_ROLES = CollectionUtil.toList("ROLE_ADMIN", "ROLE_MANAGE");
@Override
public IPage<ThreadPoolRespDTO> queryThreadPoolPage(ThreadPoolQueryReqDTO reqDTO) {
LambdaQueryWrapper<ConfigAllInfo> wrapper = Wrappers.lambdaQuery(ConfigAllInfo.class)
@ -83,8 +87,7 @@ public class ThreadPoolServiceImpl implements ThreadPoolService {
@Override
public void saveOrUpdateThreadPoolConfig(String identify, ThreadPoolSaveOrUpdateReqDTO reqDTO) {
// TODO to optimize the Role of judgment
if (UserContext.getUserRole().equals("ROLE_ADMIN")) {
if (AUDITABLE_ROLES.contains(UserContext.getUserRole())) {
ConfigAllInfo configAllInfo = BeanUtil.convert(reqDTO, ConfigAllInfo.class);
Long executeTimeOut = Objects.equals(configAllInfo.getExecuteTimeOut(), 0L) ? null : configAllInfo.getExecuteTimeOut();
configAllInfo.setExecuteTimeOut(executeTimeOut);
@ -98,7 +101,6 @@ public class ThreadPoolServiceImpl implements ThreadPoolService {
modifySaveReqDTO.setType(ConfigModifyTypeConstants.THREAD_POOL_MANAGER);
configModificationVerifyServiceChoose.choose(modifySaveReqDTO.getType()).saveConfigModifyApplication(modifySaveReqDTO);
}
}
@Override

File diff suppressed because one or more lines are too long

@ -1 +1 @@
.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.pagination-container[data-v-df7d1fa0]{background:#fff;padding:32px 16px}.pagination-container.hidden[data-v-df7d1fa0]{display:none}[data-v-41b2dc5c]::-webkit-scrollbar{width:8px;height:8px}[data-v-41b2dc5c]::-webkit-scrollbar-track{border-radius:5px;background:rgba(0,0,0,.06);-webkit-box-shadow:inset 0 0 5px rgba(0,0,0,.08)}[data-v-41b2dc5c]::-webkit-scrollbar-thumb{border-radius:5px;background:rgba(0,0,0,.12);-webkit-box-shadow:inset 0 0 10px rgba(0,0,0,.2)}.stack-info[data-v-41b2dc5c]{height:400px;overflow:auto}.stack-info>li[data-v-41b2dc5c]{margin-bottom:24px}.stack-info>li p[data-v-41b2dc5c]:first-child{color:#06f;font-weight:600;margin-top:10px}.stack-info>li ul[data-v-41b2dc5c]{margin-left:30px}.stack-info>li ul li[data-v-41b2dc5c]{color:#fc5531;text-align:justify;margin:10px auto}
.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.pagination-container[data-v-df7d1fa0]{background:#fff;padding:32px 16px}.pagination-container.hidden[data-v-df7d1fa0]{display:none}[data-v-a1fe05c0]::-webkit-scrollbar{width:8px;height:8px}[data-v-a1fe05c0]::-webkit-scrollbar-track{border-radius:5px;background:rgba(0,0,0,.06);-webkit-box-shadow:inset 0 0 5px rgba(0,0,0,.08)}[data-v-a1fe05c0]::-webkit-scrollbar-thumb{border-radius:5px;background:rgba(0,0,0,.12);-webkit-box-shadow:inset 0 0 10px rgba(0,0,0,.2)}.stack-info[data-v-a1fe05c0]{height:400px;overflow:auto}.stack-info>li[data-v-a1fe05c0]{margin-bottom:24px}.stack-info>li p[data-v-a1fe05c0]:first-child{color:#06f;font-weight:600;margin-top:10px}.stack-info>li ul[data-v-a1fe05c0]{margin-left:30px}.stack-info>li ul li[data-v-a1fe05c0]{color:#fc5531;text-align:justify;margin:10px auto}

@ -86,7 +86,7 @@
<el-table-column :label="$t('threadPoolAudit.modifiedBy')" width="120">
<template slot-scope="scope"> {{ scope.row.modifyUser }}</template>
</el-table-column>
<el-table-column :label="$t('threadPoolAudit.auditStatus')" width="110">
<el-table-column :label="$t('threadPoolAudit.auditStatus')" width="130">
<template slot-scope="scope">{{
scope.row.verifyStatus | verifyStatusFilter(that)
}}</template>

Loading…
Cancel
Save