mirror of
https://github.com/documize/community.git
synced 2025-08-02 12:05:23 +02:00
Continued MySQL/PostgreSQL store provider refactoring
Refactored, renamed, removed storage related code. Basic smoke test passed for PostgreSQL whilst fully working on MySQL variants as per usual.
This commit is contained in:
parent
b455e5eaf5
commit
97beb3f4d3
81 changed files with 1454 additions and 1497 deletions
|
@ -13,12 +13,13 @@ package user
|
|||
|
||||
import (
|
||||
"github.com/documize/community/domain"
|
||||
"github.com/documize/community/domain/store"
|
||||
"github.com/documize/community/model/user"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// GetSecuredUser contain associated accounts but credentials are wiped.
|
||||
func GetSecuredUser(ctx domain.RequestContext, s domain.Store, orgID, id string) (u user.User, err error) {
|
||||
func GetSecuredUser(ctx domain.RequestContext, s store.Store, orgID, id string) (u user.User, err error) {
|
||||
u, err = s.User.Get(ctx, id)
|
||||
AttachUserAccounts(ctx, s, orgID, &u)
|
||||
|
||||
|
@ -26,7 +27,7 @@ func GetSecuredUser(ctx domain.RequestContext, s domain.Store, orgID, id string)
|
|||
}
|
||||
|
||||
// AttachUserAccounts attachs user accounts to user object.
|
||||
func AttachUserAccounts(ctx domain.RequestContext, s domain.Store, orgID string, u *user.User) {
|
||||
func AttachUserAccounts(ctx domain.RequestContext, s store.Store, orgID string, u *user.User) {
|
||||
u.ProtectSecrets()
|
||||
|
||||
a, err := s.Account.GetUserAccounts(ctx, u.RefID)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue