Documentation
¶
Index ¶
- type User
- func (u *User) AddRole(role role.Role)
- func (u *User) Delete()
- func (u *User) HasPermission(name string) bool
- func (u *User) HasRole(name string) bool
- func (u *User) IsDeleted() bool
- func (u *User) Permissions() []permission.Permission
- func (u *User) RemoveRole(role role.Role)
- func (u *User) Restore()
- func (u *User) SetPasswordHash(passwordHash password.PasswordHash)
- func (u *User) UpdateEmailAddress(emailAddress string)
- func (u *User) UpdateFirstName(firstName string)
- func (u *User) UpdateLastName(lastName string)
- type UserRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct {
Id _type.GormUlid `json:"id" gorm:"primaryKey;size:26;not null"`
FirstName string `json:"first_name" gorm:"size:100;not null"`
LastName string `json:"last_name" gorm:"size:100;not null"`
EmailAddress string `json:"email_address" gorm:"size:100;not null"`
PasswordHash password.PasswordHash `json:"-" gorm:"column:password;size:255;default:null"`
Roles []role.Role `json:"roles" gorm:"many2many:user_roles"`
CreatedAt time.Time `json:"created_at" gorm:"not null"`
ModifiedAt time.Time `json:"modified_at" gorm:"not null"`
DeletedAt time.Time `json:"deleted_at" gorm:"default:null"` // TODO: Make nullable/optional
}
func (*User) HasPermission ¶
func (*User) Permissions ¶
func (u *User) Permissions() []permission.Permission
func (*User) RemoveRole ¶
func (*User) SetPasswordHash ¶
func (u *User) SetPasswordHash(passwordHash password.PasswordHash)
func (*User) UpdateEmailAddress ¶
func (*User) UpdateFirstName ¶
func (*User) UpdateLastName ¶
Click to show internal directories.
Click to hide internal directories.