mirror of
https://github.com/notherealmarco/WASAPhoto.git
synced 2025-05-05 20:32:35 +02:00
Add update username method
This commit is contained in:
parent
626b7fa3e9
commit
7c2c993dc3
10 changed files with 82 additions and 9 deletions
|
@ -12,6 +12,14 @@ import (
|
|||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type AuthStatus int
|
||||
|
||||
const (
|
||||
AUTHORIZED = 0
|
||||
UNAUTHORIZED = 1
|
||||
FORBIDDEN = 2
|
||||
)
|
||||
|
||||
// RequestContext is the context of the request, for request-dependent parameters
|
||||
type RequestContext struct {
|
||||
// ReqUUID is the request unique ID
|
||||
|
@ -26,5 +34,5 @@ type RequestContext struct {
|
|||
type Authorization interface {
|
||||
GetType() string
|
||||
Authorized(db database.AppDatabase) (bool, error)
|
||||
UserAuthorized(db database.AppDatabase, uid string) (bool, error)
|
||||
UserAuthorized(db database.AppDatabase, uid string) (AuthStatus, error)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue