From f837ea6346ac720d586eda51ab89c5c71a1f3e65 Mon Sep 17 00:00:00 2001 From: Joe Chen Date: Sat, 11 Jun 2022 09:42:17 +0800 Subject: db: use `context` and go-mockgen for `UsersStore` (#7042) --- internal/db/user.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'internal/db/user.go') diff --git a/internal/db/user.go b/internal/db/user.go index c6bee120..ebfbf082 100644 --- a/internal/db/user.go +++ b/internal/db/user.go @@ -942,7 +942,8 @@ func GetUserByID(id int64) (*User, error) { // GetAssigneeByID returns the user with read access of repository by given ID. func GetAssigneeByID(repo *Repository, userID int64) (*User, error) { - if !Perms.Authorize(context.TODO(), userID, repo.ID, AccessModeRead, + ctx := context.TODO() + if !Perms.Authorize(ctx, userID, repo.ID, AccessModeRead, AccessModeOptions{ OwnerID: repo.OwnerID, Private: repo.IsPrivate, @@ -950,7 +951,7 @@ func GetAssigneeByID(repo *Repository, userID int64) (*User, error) { ) { return nil, ErrUserNotExist{args: map[string]interface{}{"userID": userID}} } - return Users.GetByID(userID) + return Users.GetByID(ctx, userID) } // GetUserByName returns a user by given name. -- cgit v1.2.3