admin: Allow impersonation and deactivation

This commit is contained in:
Tom Wiesing 2023-01-17 12:25:23 +01:00
parent 2384ee0841
commit 7d0fb60d67
No known key found for this signature in database
6 changed files with 74 additions and 5 deletions

View file

@ -17,6 +17,10 @@ type User struct {
Admin *bool `gorm:"column:admin;not null"`
}
func (user *User) HasPassword() bool {
return len(user.PasswordHash) != 0
}
func (user *User) IsAdmin() bool {
return user.Admin != nil && *user.Admin
}