Преглед изворни кода

excluded users can do nothing

boyska пре 6 година
родитељ
комит
5a54a6da8a
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      conf.go

+ 3 - 0
conf.go

@@ -214,6 +214,9 @@ func (c *Config) GetShareURL(sharename string) (url.URL, error) {
 // GetAuthShares returns an array of all the shares the user is authorized to use, including its home.
 // GetAuthShares returns an array of all the shares the user is authorized to use, including its home.
 func (c *Config) GetAuthShares(username string) []Share {
 func (c *Config) GetAuthShares(username string) []Share {
 	shares := make([]Share, 0)
 	shares := make([]Share, 0)
+	if c.Global.Excluded.Has(username) {
+		return shares
+	}
 	for _, s := range c.Shares {
 	for _, s := range c.Shares {
 		if s.IsAuthorized(username) {
 		if s.IsAuthorized(username) {
 			shares = append(shares, s)
 			shares = append(shares, s)