xingzai 1 rok temu
rodzic
commit
928a5f285b
1 zmienionych plików z 20 dodań i 0 usunięć
  1. 20 0
      services/activity.go

+ 20 - 0
services/activity.go

@@ -825,6 +825,26 @@ func GetActivityDetailUserPower(user *models.WxUserItem, activityInfo *models.Ac
 		havePower = false
 		return
 	}
+	// 处理本组可见权限
+	if activityInfo.VisibleRange == 1 {
+		adminIds, e := models.GetSelleridWhichGroup(user.CompanyId, 2)
+		if e != nil {
+			err = errors.New("GetSelleridWhichGroup, Err: " + e.Error())
+			return
+		}
+		haveVisibleRange := false
+		adminIdSlice := strings.Split(adminIds, ",")
+
+		for _, v := range adminIdSlice {
+			if v == strconv.Itoa(activityInfo.AdminId) {
+				haveVisibleRange = true
+			}
+		}
+		if !haveVisibleRange {
+			havePower = false
+			return
+		}
+	}
 	userType, permissionStr, permissionStrZhengShi, e := GetUserTypeZhengShi(user.CompanyId)
 	if e != nil {
 		err = errors.New("GetCompanyPermissionUpgrade, Err: " + e.Error())