admin: Allow impersonation and deactivation
This commit is contained in:
parent
2384ee0841
commit
7d0fb60d67
6 changed files with 74 additions and 5 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue