作者 yangfu

权限修改

@@ -1934,29 +1934,30 @@ func Permission(header *protocol.RequestHeader, request *protocol.PermissionRequ @@ -1934,29 +1934,30 @@ func Permission(header *protocol.RequestHeader, request *protocol.PermissionRequ
1934 rsp.EditScore = 0 1934 rsp.EditScore = 0
1935 } 1935 }
1936 } 1936 }
1937 -  
1938 - //他人  
1939 - if auditProcess, err = models.GetAuditFlowProcessListByAuditUser(request.ChanceId, header.UserId); err != nil {  
1940 - if err == orm.ErrNoRows {  
1941 - if chance.ReviewStatus != protocol.ReviewStatusPass {  
1942 - rsp.EditChance = 0 1937 + if chance.UserId != header.UserId {
  1938 + //他人
  1939 + if auditProcess, err = models.GetAuditFlowProcessListByAuditUser(request.ChanceId, header.UserId); err != nil {
  1940 + if err == orm.ErrNoRows {
  1941 + if chance.ReviewStatus != protocol.ReviewStatusPass {
  1942 + rsp.EditChance = 0
  1943 + }
  1944 + err = nil
  1945 + return
1943 } 1946 }
1944 - err = nil  
1945 - return  
1946 } 1947 }
1947 - }  
1948 - for i := range auditProcess {  
1949 - if auditProcess[i].ReviewStatus == protocol.ReviewStatusAuditging {  
1950 - isApproving = true  
1951 - log.Debug(fmt.Sprintf("用户:%v 审核中 编辑权限:true", header.UserId))  
1952 - break 1948 + for i := range auditProcess {
  1949 + if auditProcess[i].ReviewStatus == protocol.ReviewStatusAuditging {
  1950 + isApproving = true
  1951 + log.Debug(fmt.Sprintf("用户:%v 审核中 编辑权限:true", header.UserId))
  1952 + break
  1953 + }
  1954 + }
  1955 + if isApproving {
  1956 + rsp.EditChance = 1
  1957 + } else if chance.ReviewStatus == protocol.ReviewStatusAuditging && len(auditProcess) > 0 {
  1958 + rsp.EditChance = 0
  1959 + log.Debug(fmt.Sprintf("用户:%v 审核过,并且当前机会在审核中 编辑权限:false", header.UserId))
1953 } 1960 }
1954 - }  
1955 - if isApproving {  
1956 - rsp.EditChance = 1  
1957 - } else if chance.ReviewStatus == protocol.ReviewStatusAuditging && len(auditProcess) > 0 {  
1958 - rsp.EditChance = 0  
1959 - log.Debug(fmt.Sprintf("用户:%v 审核过,并且当前机会在审核中 编辑权限:false", header.UserId))  
1960 } 1961 }
1961 } 1962 }
1962 return 1963 return