mirror of
https://github.com/1f349/lavender.git
synced 2024-11-09 22:32:48 +00:00
18 lines
350 B
Go
18 lines
350 B
Go
|
package server
|
||
|
|
||
|
// DomainOwnership is the structure for storing if a user owns a domain
|
||
|
type DomainOwnership map[string][]string
|
||
|
|
||
|
func (d DomainOwnership) AllOwns(user string) []string {
|
||
|
return d[user]
|
||
|
}
|
||
|
|
||
|
func (d DomainOwnership) Owns(user, domain string) bool {
|
||
|
for _, i := range d[user] {
|
||
|
if i == domain {
|
||
|
return true
|
||
|
}
|
||
|
}
|
||
|
return false
|
||
|
}
|