Solved some todo(s)

This commit is contained in:
Marco Realacci 2022-11-22 22:47:17 +01:00
parent 05acfb045f
commit a3cf4f17f8
5 changed files with 27 additions and 30 deletions

View file

@ -0,0 +1,19 @@
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)
}