...
|
...
|
@@ -1934,29 +1934,30 @@ func Permission(header *protocol.RequestHeader, request *protocol.PermissionRequ |
|
|
rsp.EditScore = 0
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//他人
|
|
|
if auditProcess, err = models.GetAuditFlowProcessListByAuditUser(request.ChanceId, header.UserId); err != nil {
|
|
|
if err == orm.ErrNoRows {
|
|
|
if chance.ReviewStatus != protocol.ReviewStatusPass {
|
|
|
rsp.EditChance = 0
|
|
|
if chance.UserId != header.UserId {
|
|
|
//他人
|
|
|
if auditProcess, err = models.GetAuditFlowProcessListByAuditUser(request.ChanceId, header.UserId); err != nil {
|
|
|
if err == orm.ErrNoRows {
|
|
|
if chance.ReviewStatus != protocol.ReviewStatusPass {
|
|
|
rsp.EditChance = 0
|
|
|
}
|
|
|
err = nil
|
|
|
return
|
|
|
}
|
|
|
err = nil
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
for i := range auditProcess {
|
|
|
if auditProcess[i].ReviewStatus == protocol.ReviewStatusAuditging {
|
|
|
isApproving = true
|
|
|
log.Debug(fmt.Sprintf("用户:%v 审核中 编辑权限:true", header.UserId))
|
|
|
break
|
|
|
for i := range auditProcess {
|
|
|
if auditProcess[i].ReviewStatus == protocol.ReviewStatusAuditging {
|
|
|
isApproving = true
|
|
|
log.Debug(fmt.Sprintf("用户:%v 审核中 编辑权限:true", header.UserId))
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
if isApproving {
|
|
|
rsp.EditChance = 1
|
|
|
} else if chance.ReviewStatus == protocol.ReviewStatusAuditging && len(auditProcess) > 0 {
|
|
|
rsp.EditChance = 0
|
|
|
log.Debug(fmt.Sprintf("用户:%v 审核过,并且当前机会在审核中 编辑权限:false", header.UserId))
|
|
|
}
|
|
|
}
|
|
|
if isApproving {
|
|
|
rsp.EditChance = 1
|
|
|
} else if chance.ReviewStatus == protocol.ReviewStatusAuditging && len(auditProcess) > 0 {
|
|
|
rsp.EditChance = 0
|
|
|
log.Debug(fmt.Sprintf("用户:%v 审核过,并且当前机会在审核中 编辑权限:false", header.UserId))
|
|
|
}
|
|
|
}
|
|
|
return
|
...
|
...
|
|