fix merge

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
This commit is contained in:
bcmmbaga 2024-09-18 16:11:20 +03:00
parent a4c4158bcf
commit 021fc8f33e
No known key found for this signature in database
GPG Key ID: 511EED5C928AD547
2 changed files with 4 additions and 6 deletions

View File

@ -1745,7 +1745,7 @@ func (am *DefaultAccountManager) GetAccountFromToken(ctx context.Context, claims
return "", "", err return "", "", err
} }
user, err := am.Store.GetUserByUserID(ctx, claims.UserId) user, err := am.Store.GetUserByUserID(ctx, LockingStrengthShare, claims.UserId)
if err != nil { if err != nil {
// this is not really possible because we got an account by user ID // this is not really possible because we got an account by user ID
return "", "", status.Errorf(status.NotFound, "user %s not found", claims.UserId) return "", "", status.Errorf(status.NotFound, "user %s not found", claims.UserId)
@ -1768,7 +1768,7 @@ func (am *DefaultAccountManager) GetAccountFromToken(ctx context.Context, claims
// syncJWTGroups processes the JWT groups for a user, updates the account based on the groups, // syncJWTGroups processes the JWT groups for a user, updates the account based on the groups,
// and propagates changes to peers if group propagation is enabled. // and propagates changes to peers if group propagation is enabled.
func (am *DefaultAccountManager) syncJWTGroups(ctx context.Context, claims jwtclaims.AuthorizationClaims, accountID string) error { func (am *DefaultAccountManager) syncJWTGroups(ctx context.Context, claims jwtclaims.AuthorizationClaims, accountID string) error {
settings, err := am.Store.GetAccountSettings(ctx, accountID) settings, err := am.Store.GetAccountSettings(ctx, LockingStrengthShare, accountID)
if err != nil { if err != nil {
return err return err
} }
@ -2033,7 +2033,7 @@ func (am *DefaultAccountManager) CheckUserAccessByJWTGroups(ctx context.Context,
return err return err
} }
settings, err := am.Store.GetAccountSettings(ctx, accountID) settings, err := am.Store.GetAccountSettings(ctx, LockingStrengthShare, accountID)
if err != nil { if err != nil {
return err return err
} }

View File

@ -359,9 +359,7 @@ func (am *DefaultAccountManager) inviteNewUser(ctx context.Context, accountID, u
// GetUserByID looks up a user by provided user id. // GetUserByID looks up a user by provided user id.
func (am *DefaultAccountManager) GetUserByID(ctx context.Context, id string) (*User, error) { func (am *DefaultAccountManager) GetUserByID(ctx context.Context, id string) (*User, error) {
unlock := am.Store.AcquireReadLockByUID(ctx, id) return am.Store.GetUserByUserID(ctx, LockingStrengthShare, id)
defer unlock()
return am.Store.GetUserByUserID(ctx, id)
} }
// GetUser looks up a user by provided authorization claims. // GetUser looks up a user by provided authorization claims.