66699089c0d29ccc2199f112fda9d4f750760fc8
- Author
- Ayman Bagabas <ayman.bagabas@gmail.com>
- Committer
- Ayman Bagabas <ayman.bagabas@gmail.com>
- Date
Message
feat(config): add repo collabs
A repo config now can take a list of collab user names.
Diff
1diff --git a/config/auth.go b/config/auth.go
2index 0bbcaa6e1dbaaebc7ac1d3ec966a709bc540d3b4..ff1d3c0567a75b42535a68ddf54789a8994c2917 100644
3--- a/config/auth.go
4+++ b/config/auth.go
5@@ -120,6 +120,11 @@ OUT:
6 if anon > ac {
7 ac = anon
8 }
9+ for _, c := range r.Collabs {
10+ if c == u.Name {
11+ return ac
12+ }
13+ }
14 for _, rr := range u.CollabRepos {
15 if rr == r.Repo {
16 return ac
17diff --git a/config/config.go b/config/config.go
18index da6ff3e5d0c9d657e7d3e8c01d89197350c54946..40b77d1339cf425df810c4314135c7cde80e5621 100644
19--- a/config/config.go
20+++ b/config/config.go
21@@ -51,11 +51,12 @@ type User struct {
22
23 // RepoConfig is a repository configuration.
24 type RepoConfig struct {
25- Name string `yaml:"name" json:"name"`
26- Repo string `yaml:"repo" json:"repo"`
27- Note string `yaml:"note" json:"note"`
28- Private bool `yaml:"private" json:"private"`
29- Readme string `yaml:"readme" json:"readme"`
30+ Name string `yaml:"name" json:"name"`
31+ Repo string `yaml:"repo" json:"repo"`
32+ Note string `yaml:"note" json:"note"`
33+ Private bool `yaml:"private" json:"private"`
34+ Readme string `yaml:"readme" json:"readme"`
35+ Collabs []string `yaml:"collabs" json:"collabs"`
36 }
37
38 // NewConfig creates a new internal Config struct.