feat: send commands too

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
This commit is contained in:
Henrique Dias 2018-12-30 14:12:23 +00:00
parent bc7464d3f5
commit cca1eac74e
2 changed files with 4 additions and 0 deletions

View File

@ -84,6 +84,7 @@ type userInfo struct {
Locale string `json:"locale"` Locale string `json:"locale"`
ViewMode types.ViewMode `json:"viewMode"` ViewMode types.ViewMode `json:"viewMode"`
Perm types.Permissions `json:"perm"` Perm types.Permissions `json:"perm"`
Commands []string `json:"commands"`
LockPassword bool `json:"lockPassword"` LockPassword bool `json:"lockPassword"`
} }
@ -143,6 +144,7 @@ func (e *Env) printToken(w http.ResponseWriter, r *http.Request, user *types.Use
ViewMode: user.ViewMode, ViewMode: user.ViewMode,
Perm: user.Perm, Perm: user.Perm,
LockPassword: user.LockPassword, LockPassword: user.LockPassword,
Commands: user.Commands,
}, },
StandardClaims: jwt.StandardClaims{ StandardClaims: jwt.StandardClaims{
ExpiresAt: time.Now().Add(time.Hour * 24).Unix(), ExpiresAt: time.Now().Add(time.Hour * 24).Unix(),

View File

@ -7,6 +7,8 @@ type Store struct {
Share ShareStore Share ShareStore
} }
// TODO: wrappers to verify
// UsersStore is used to manage users relativey to a data storage. // UsersStore is used to manage users relativey to a data storage.
type UsersStore interface { type UsersStore interface {
Get(id uint) (*User, error) Get(id uint) (*User, error)