Loggest thy stuff
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
624 B

  1. package models
  2. type ScopeEntry struct {
  3. ID int `json:"id"`
  4. Name string `json:"name"`
  5. Abbreviation string `json:"abbreviation"`
  6. }
  7. type ScopeMember struct {
  8. ID string `json:"id"`
  9. Name string `json:"name"`
  10. Owner bool `json:"owner"`
  11. }
  12. type Scope struct {
  13. ScopeEntry
  14. DisplayName string `json:"displayName"`
  15. Members []ScopeMember `json:"members"`
  16. Projects []ProjectEntry `json:"projects"`
  17. Stats []Stat `json:"stats"`
  18. }
  19. func (s *Scope) HasMember(id string) bool {
  20. for _, user := range s.Members {
  21. if user.ID == id {
  22. return true
  23. }
  24. }
  25. return false
  26. }