Selaa lähdekoodia

feature(权限):添加战略项目组权限,可访问所有的400和储备项目

ZZH-wl 1 vuosi sitten
vanhempi
commit
26c8a563ae

+ 4 - 0
opms_parent/app/dao/proj/internal/proj_business.go

@@ -912,6 +912,10 @@ func (d *ProjBusinessDao) DataScope(ctx context.Context, userCol ...string) *Pro
 			if arr.Len() == 1 && arr.Contains("SalesEngineer") {
 				salesEngineerFlag = true
 			}
+			// 战略项目组可以看所有的储备项目
+			if arr.Contains("StrategicProjectTeam") {
+				orColumns = append(orColumns, tableAs+"nbo_type = '50' ")
+			}
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {

+ 3 - 1
opms_parent/app/service/cust/product_consult_record.go

@@ -70,7 +70,9 @@ func (s ProductConsultRecordService) List(ctx context.Context, req *model.Produc
 		dao = dao.Where("unit like ?", likestr)
 	}
 	// 权限限制(销售工程师看自己的)
-	if service.StringsContains(s.userInfo.Roles, "SalesEngineer") {
+	if service.StringsContains(s.userInfo.Roles, "StrategicProjectTeam") {
+
+	} else if service.StringsContains(s.userInfo.Roles, "SalesEngineer") {
 		dao = dao.Where("incharge_id like ?", s.userInfo.Id)
 	}