prevent child account user from being restricted

This commit is contained in:
Pedro Costa
2025-04-29 19:27:08 +01:00
parent a404bb1ef4
commit 4988032f87
6 changed files with 51 additions and 39 deletions

View File

@@ -128,8 +128,8 @@ func initUsersTestData() *handler {
return nil
},
GetCurrentUserInfoFunc: func(ctx context.Context, accountID, userID string) (*users.UserInfoWithPermissions, error) {
switch userID {
GetCurrentUserInfoFunc: func(ctx context.Context, userAuth nbcontext.UserAuth) (*users.UserInfoWithPermissions, error) {
switch userAuth.UserId {
case "not-found":
return nil, status.NewUserNotFoundError("not-found")
case "not-of-account":
@@ -200,7 +200,7 @@ func initUsersTestData() *handler {
}, nil
}
return nil, fmt.Errorf("user id %s not handled", userID)
return nil, fmt.Errorf("user id %s not handled", userAuth.UserId)
},
},
}