Documentation ¶
Index ¶
Constants ¶
View Source
const ( CreatorsGroupName string = "creators" AdminsGroupName string = "admin" SuperAdminsGroupName string = "super-admin" PlayersGroupName string = "players" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct { model.Base Email string `gorm:"unique;uniqueIndex"` Name string Groups []Group `gorm:"many2many:user_groups;"` AdminOfGroups []Group `gorm:"many2many:group_admins;"` Domain string //Likely just to be part of the email LastIdProvider string }
func (*User) CanReadObject ¶
func (user *User) CanReadObject(userObject *UserObject) bool
func (*User) CanWriteObject ¶
func (user *User) CanWriteObject(userObject *UserObject) bool
type UserObject ¶
type UserObject struct { model.Base OwnerID uuid.UUID `json:"ownerId"` Owner User `json:"-"` //Gorm should use the field above to create an association by foreign key. GroupID uuid.UUID `json:"-"` Group Group `json:"group"` Permissions ACL `gorm:"embedded;embeddedPrefix:acl_"` }
func (*UserObject) BeforeCreate ¶
func (userObject *UserObject) BeforeCreate(db *gorm.DB) error
Click to show internal directories.
Click to hide internal directories.