作者 yangfu

权限修改

@@ -1916,6 +1916,7 @@ func Permission(header *protocol.RequestHeader, request *protocol.PermissionRequ @@ -1916,6 +1916,7 @@ func Permission(header *protocol.RequestHeader, request *protocol.PermissionRequ
1916 chance *models.Chance 1916 chance *models.Chance
1917 auditProcess []*models.AuditFlowProcess 1917 auditProcess []*models.AuditFlowProcess
1918 isApproving bool //是否审核中 1918 isApproving bool //是否审核中
  1919 + company *models.Company
1919 ) 1920 )
1920 rsp = &protocol.PermissionResponse{} 1921 rsp = &protocol.PermissionResponse{}
1921 if op, err = agg.GetUserPermission(header.UserId); err == nil { 1922 if op, err = agg.GetUserPermission(header.UserId); err == nil {
@@ -1937,6 +1938,15 @@ func Permission(header *protocol.RequestHeader, request *protocol.PermissionRequ @@ -1937,6 +1938,15 @@ func Permission(header *protocol.RequestHeader, request *protocol.PermissionRequ
1937 rsp.EditPublicStatus = 1 1938 rsp.EditPublicStatus = 1
1938 rsp.EditScore = 1 1939 rsp.EditScore = 1
1939 } 1940 }
  1941 + if company, err = models.GetCompanyById(header.CompanyId); err != nil {
  1942 + log.Error(err)
  1943 + return
  1944 + }
  1945 + //公司管理员有所有权限
  1946 + if company.AdminId == header.UserId {
  1947 + allPermission()
  1948 + return
  1949 + }
1940 //无权限 1950 //无权限
1941 noPermission := func() { 1951 noPermission := func() {
1942 rsp.EditChance = 0 1952 rsp.EditChance = 0