Documentation
¶
Index ¶
- Constants
- Variables
- func AssignableRole(role string) bool
- func CanLeave(role string, isLastOwner bool) bool
- func EmailOK(email string) bool
- func HashShareCode(code string) string
- func InviteExpiry(now time.Time) time.Time
- func LastOwnerProtected(targetRole string, targetIsLastOwner bool, action RoleAction) bool
- func MintShareCode() (string, error)
- func NormalizeEmail(email string) string
- func ShareCodeOK(code string) bool
- func SlugOK(slug string) bool
- func SlugReserved(slug string) bool
- type RoleAction
Constants ¶
View Source
const ( RoleOwner = "owner" RoleAdmin = "admin" RoleMember = "member" )
View Source
const ( InviteTTL = 7 * 24 * time.Hour )
Variables ¶
Functions ¶
func AssignableRole ¶
func HashShareCode ¶
func LastOwnerProtected ¶
func LastOwnerProtected(targetRole string, targetIsLastOwner bool, action RoleAction) bool
func MintShareCode ¶
func NormalizeEmail ¶
func ShareCodeOK ¶
func SlugReserved ¶
Types ¶
type RoleAction ¶
type RoleAction int
const ( ActionDemote RoleAction = iota + 1 ActionRemove ActionPromote )
Click to show internal directories.
Click to hide internal directories.