diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-11-28 12:58:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-28 12:58:28 +0100 |
commit | 1fee11d69a437ec7e68b3f6b645827592fe77292 (patch) | |
tree | 1fca452f96746d9f7cc8c31723e3c365155cf96d /integrations/api_helper_for_declarative_test.go | |
parent | Disable ref selection dropdown if you don't have permissions to use it (#17837) (diff) | |
download | forgejo-1fee11d69a437ec7e68b3f6b645827592fe77292.tar.xz forgejo-1fee11d69a437ec7e68b3f6b645827592fe77292.zip |
Move accessmode into models/perm (#17828)
Diffstat (limited to 'integrations/api_helper_for_declarative_test.go')
-rw-r--r-- | integrations/api_helper_for_declarative_test.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/integrations/api_helper_for_declarative_test.go b/integrations/api_helper_for_declarative_test.go index 8745ada96d..a8aba3199c 100644 --- a/integrations/api_helper_for_declarative_test.go +++ b/integrations/api_helper_for_declarative_test.go @@ -14,6 +14,7 @@ import ( "time" "code.gitea.io/gitea/models" + "code.gitea.io/gitea/models/perm" "code.gitea.io/gitea/modules/json" "code.gitea.io/gitea/modules/queue" api "code.gitea.io/gitea/modules/structs" @@ -89,13 +90,13 @@ func doAPIEditRepository(ctx APITestContext, editRepoOption *api.EditRepoOption, } } -func doAPIAddCollaborator(ctx APITestContext, username string, mode models.AccessMode) func(*testing.T) { +func doAPIAddCollaborator(ctx APITestContext, username string, mode perm.AccessMode) func(*testing.T) { return func(t *testing.T) { permission := "read" - if mode == models.AccessModeAdmin { + if mode == perm.AccessModeAdmin { permission = "admin" - } else if mode > models.AccessModeRead { + } else if mode > perm.AccessModeRead { permission = "write" } addCollaboratorOption := &api.AddCollaboratorOption{ |