aboutsummaryrefslogtreecommitdiffstats
path: root/integrations/api_repo_test.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-05-11 18:09:36 +0800
committerGitHub <noreply@github.com>2022-05-11 12:09:36 +0200
commitcbd45471b1100bffcd2f18719b56a5da5468756b (patch)
tree11fcb818fd4e9d7b6bdb97d1b5bfbe2ed3df5747 /integrations/api_repo_test.go
parent8e8e936adacea873013b89d534f60207e67f2b05 (diff)
downloadgitea-cbd45471b1100bffcd2f18719b56a5da5468756b.tar.gz
gitea-cbd45471b1100bffcd2f18719b56a5da5468756b.zip
Move access and repo permission to models/perm/access (#19350)
* Move access and repo permission to models/perm/access * Remove unnecessary code
Diffstat (limited to 'integrations/api_repo_test.go')
-rw-r--r--integrations/api_repo_test.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/integrations/api_repo_test.go b/integrations/api_repo_test.go
index b585ad15e3..e635a4f377 100644
--- a/integrations/api_repo_test.go
+++ b/integrations/api_repo_test.go
@@ -12,6 +12,8 @@ import (
"testing"
"code.gitea.io/gitea/models"
+ "code.gitea.io/gitea/models/db"
+ access_model "code.gitea.io/gitea/models/perm/access"
repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/models/unittest"
user_model "code.gitea.io/gitea/models/user"
@@ -205,7 +207,7 @@ func TestAPISearchRepo(t *testing.T) {
assert.Len(t, repoNames, expected.count)
for _, repo := range body.Data {
r := getRepo(t, repo.ID)
- hasAccess, err := models.HasAccess(userID, r)
+ hasAccess, err := access_model.HasAccess(db.DefaultContext, userID, r)
assert.NoError(t, err, "Error when checking if User: %d has access to %s: %v", userID, repo.FullName, err)
assert.True(t, hasAccess, "User: %d does not have access to %s", userID, repo.FullName)