1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-05-28 09:25:37 +02:00

JS error handling

This commit is contained in:
binwiederhier 2023-02-02 15:19:37 -05:00
parent 180a7df1e7
commit 0885951a67
20 changed files with 369 additions and 366 deletions

View file

@ -33,6 +33,16 @@ func (u *User) TierID() string {
return u.Tier.ID
}
// Admin returns true if the user is an admin
func (u *User) Admin() bool {
return u != nil && u.Role == RoleAdmin
}
// User returns true if the user is a regular user, not an admin
func (u *User) User() bool {
return !u.Admin()
}
// Auther is an interface for authentication and authorization
type Auther interface {
// Authenticate checks username and password and returns a user if correct. The method