aboutsummaryrefslogtreecommitdiffstats
path: root/models/perm/access
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-12-03 10:48:26 +0800
committerGitHub <noreply@github.com>2022-12-03 10:48:26 +0800
commit0a7d3ff786508284224ada17956a65bb759d9265 (patch)
tree4860fca95c1432ab59c6723ee2b053b1c7d6779d /models/perm/access
parent8698458f48eafeab21014db544aa7160368856e1 (diff)
downloadgitea-0a7d3ff786508284224ada17956a65bb759d9265.tar.gz
gitea-0a7d3ff786508284224ada17956a65bb759d9265.zip
refactor some functions to support ctx as first parameter (#21878)
Co-authored-by: KN4CK3R <admin@oldschoolhack.me> Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'models/perm/access')
-rw-r--r--models/perm/access/access.go2
-rw-r--r--models/perm/access/repo_permission.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/models/perm/access/access.go b/models/perm/access/access.go
index 55d3f78e01..48ecf78a8c 100644
--- a/models/perm/access/access.go
+++ b/models/perm/access/access.go
@@ -171,7 +171,7 @@ func RecalculateTeamAccesses(ctx context.Context, repo *repo_model.Repository, i
continue
}
- if err = t.GetMembersCtx(ctx); err != nil {
+ if err = t.LoadMembers(ctx); err != nil {
return fmt.Errorf("getMembers '%d': %w", t.ID, err)
}
for _, m := range t.Members {
diff --git a/models/perm/access/repo_permission.go b/models/perm/access/repo_permission.go
index 58c4299d16..88437dc4b2 100644
--- a/models/perm/access/repo_permission.go
+++ b/models/perm/access/repo_permission.go
@@ -364,7 +364,7 @@ func HasAccess(ctx context.Context, userID int64, repo *repo_model.Repository) (
var user *user_model.User
var err error
if userID > 0 {
- user, err = user_model.GetUserByIDCtx(ctx, userID)
+ user, err = user_model.GetUserByID(ctx, userID)
if err != nil {
return false, err
}