mirror of
https://github.com/notherealmarco/WASAPhoto.git
synced 2025-03-14 14:16:15 +01:00
20 lines
396 B
Go
20 lines
396 B
Go
|
package reqcontext
|
||
|
|
||
|
import "github.com/notherealmarco/WASAPhoto/service/database"
|
||
|
|
||
|
type AuthStatus int
|
||
|
|
||
|
const (
|
||
|
AUTHORIZED = 0
|
||
|
UNAUTHORIZED = 1
|
||
|
FORBIDDEN = 2
|
||
|
USER_NOT_FOUND = 3
|
||
|
)
|
||
|
|
||
|
type Authorization interface {
|
||
|
GetType() string
|
||
|
GetUserID() string
|
||
|
Authorized(db database.AppDatabase) (AuthStatus, error)
|
||
|
UserAuthorized(db database.AppDatabase, uid string) (AuthStatus, error)
|
||
|
}
|