package auth type PermMask uint8 const ( None PermMask = 0 Read PermMask = 1 << iota Write Delete ) func (p PermMask) HasRead() bool { return p&Read != 0 } func (p PermMask) HasWrite() bool { return p&Write != 0 } func (p PermMask) HasDelete() bool { return p&Delete != 0 } type Account struct { Username, Password string Mask PermMask }