feat: allow regular users to login to the UI

This commit is contained in:
Deluan
2020-02-05 22:22:44 -05:00
parent e0308acef3
commit 6978790e96
5 changed files with 57 additions and 21 deletions
+8
View File
@@ -31,6 +31,14 @@ func userId(ctx context.Context) string {
return usr.ID
}
func loggedUser(ctx context.Context) *model.User {
user := ctx.Value("user")
if user == nil {
return &model.User{}
}
return user.(*model.User)
}
func (r sqlRepository) newSelect(options ...model.QueryOptions) SelectBuilder {
sq := Select().From(r.tableName)
sq = r.applyOptions(sq, options...)