Ver código fonte

Add new error type for team membership permissions

Garrett Bjerkhoel 10 anos atrás
pai
commit
979d0ca70f
1 arquivos alterados com 5 adições e 0 exclusões
  1. 5 0
      pkg/social/social.go

+ 5 - 0
pkg/social/social.go

@@ -5,6 +5,7 @@ import (
 	"fmt"
 	"fmt"
 	"strconv"
 	"strconv"
 	"strings"
 	"strings"
+	"errors"
 
 
 	"github.com/grafana/grafana/pkg/models"
 	"github.com/grafana/grafana/pkg/models"
 	"github.com/grafana/grafana/pkg/setting"
 	"github.com/grafana/grafana/pkg/setting"
@@ -109,6 +110,10 @@ type SocialGithub struct {
 	teamIds        []int
 	teamIds        []int
 }
 }
 
 
+var (
+	ErrMissingTeamMembership = errors.New("User not a member of one of the required teams")
+)
+
 func (s *SocialGithub) Type() int {
 func (s *SocialGithub) Type() int {
 	return int(models.GITHUB)
 	return int(models.GITHUB)
 }
 }