mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-05 05:29:29 +08:00
fix(接口测试): 场景导入加判断_跳转加权限限制
--user=郭雨琦
This commit is contained in:
parent
cf4ece462f
commit
56a30bc4f9
@ -2067,6 +2067,12 @@ public class ApiAutomationService {
|
||||
ApiScenarioWithBLOBs bloBs = getDto(object.getString("id"));
|
||||
if (bloBs == null) {
|
||||
object.put("referenced", "Copy");
|
||||
}else{
|
||||
CheckPermissionService checkPermissionService = CommonBeanFactory.getBean(CheckPermissionService.class);
|
||||
Set<String> userRelatedProjectIds = checkPermissionService.getUserRelatedProjectIds();
|
||||
if(!userRelatedProjectIds.contains(bloBs.getProjectId())){
|
||||
object.put("referenced", "Copy");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -688,11 +688,11 @@ export default {
|
||||
if (response.data) {
|
||||
workspaceId = response.data.workspaceId;
|
||||
isTurnSpace = true;
|
||||
this.gotoTurn(resource, workspaceId, isTurnSpace);
|
||||
this.checkPermission(resource, workspaceId, isTurnSpace);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.gotoTurn(resource, workspaceId, isTurnSpace);
|
||||
this.checkPermission(resource, workspaceId, isTurnSpace);
|
||||
}
|
||||
},
|
||||
clickCase(resource) {
|
||||
@ -757,6 +757,17 @@ export default {
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
checkPermission(resource, workspaceId, isTurnSpace){
|
||||
this.$get('/project/getOwnerProjectIds', res => {
|
||||
const project = res.data.find(p => p === resource.projectId);
|
||||
if(!project){
|
||||
this.$warning(this.$t('commons.no_permission'));
|
||||
}else{
|
||||
this.gotoTurn(resource, workspaceId, isTurnSpace)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -264,11 +264,11 @@ export default {
|
||||
if (response.data) {
|
||||
workspaceId = response.data.workspaceId;
|
||||
isTurnSpace = true;
|
||||
this.gotoTurn(resource,workspaceId,isTurnSpace);
|
||||
this.checkPermission(resource,workspaceId,isTurnSpace);
|
||||
}
|
||||
});
|
||||
}else {
|
||||
this.gotoTurn(resource,workspaceId,isTurnSpace);
|
||||
this.checkPermission(resource,workspaceId,isTurnSpace);
|
||||
}
|
||||
|
||||
},
|
||||
@ -280,6 +280,16 @@ export default {
|
||||
if(isTurnSpace){
|
||||
window.open(automationData.href, '_blank');
|
||||
}
|
||||
},
|
||||
checkPermission(resource,workspaceId,isTurnSpace){
|
||||
this.$get('/project/getOwnerProjectIds', res => {
|
||||
const project = res.data.find(p => p === resource.projectId);
|
||||
if(!project){
|
||||
this.$warning(this.$t('commons.no_permission'));
|
||||
}else{
|
||||
this.gotoTurn(resource,workspaceId,isTurnSpace)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user