From cca1eac74eb13c58416c603450772920443a153f Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Sun, 30 Dec 2018 14:12:23 +0000 Subject: [PATCH] feat: send commands too License: MIT Signed-off-by: Henrique Dias --- http/auth.go | 2 ++ types/storage.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/http/auth.go b/http/auth.go index 7318660f..9bbe8463 100644 --- a/http/auth.go +++ b/http/auth.go @@ -84,6 +84,7 @@ type userInfo struct { Locale string `json:"locale"` ViewMode types.ViewMode `json:"viewMode"` Perm types.Permissions `json:"perm"` + Commands []string `json:"commands"` LockPassword bool `json:"lockPassword"` } @@ -143,6 +144,7 @@ func (e *Env) printToken(w http.ResponseWriter, r *http.Request, user *types.Use ViewMode: user.ViewMode, Perm: user.Perm, LockPassword: user.LockPassword, + Commands: user.Commands, }, StandardClaims: jwt.StandardClaims{ ExpiresAt: time.Now().Add(time.Hour * 24).Unix(), diff --git a/types/storage.go b/types/storage.go index b52a308e..7de31b61 100644 --- a/types/storage.go +++ b/types/storage.go @@ -7,6 +7,8 @@ type Store struct { Share ShareStore } +// TODO: wrappers to verify + // UsersStore is used to manage users relativey to a data storage. type UsersStore interface { Get(id uint) (*User, error)