aboutsummaryrefslogtreecommitdiffstats
path: root/models/error.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-11-28 19:58:28 +0800
committerGitHub <noreply@github.com>2021-11-28 12:58:28 +0100
commit1fee11d69a437ec7e68b3f6b645827592fe77292 (patch)
tree1fca452f96746d9f7cc8c31723e3c365155cf96d /models/error.go
parent24a8d54bfb908a2371cb808a5243b3290dd0664a (diff)
downloadgitea-1fee11d69a437ec7e68b3f6b645827592fe77292.tar.gz
gitea-1fee11d69a437ec7e68b3f6b645827592fe77292.zip
Move accessmode into models/perm (#17828)
Diffstat (limited to 'models/error.go')
-rw-r--r--models/error.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/models/error.go b/models/error.go
index 5ef96683e7..0b6c22450d 100644
--- a/models/error.go
+++ b/models/error.go
@@ -8,6 +8,7 @@ package models
import (
"fmt"
+ "code.gitea.io/gitea/models/perm"
"code.gitea.io/gitea/modules/git"
)
@@ -498,7 +499,7 @@ func (err ErrLFSLockNotExist) Error() string {
type ErrLFSUnauthorizedAction struct {
RepoID int64
UserName string
- Mode AccessMode
+ Mode perm.AccessMode
}
// IsErrLFSUnauthorizedAction checks if an error is a ErrLFSUnauthorizedAction.
@@ -508,7 +509,7 @@ func IsErrLFSUnauthorizedAction(err error) bool {
}
func (err ErrLFSUnauthorizedAction) Error() string {
- if err.Mode == AccessModeWrite {
+ if err.Mode == perm.AccessModeWrite {
return fmt.Sprintf("User %s doesn't have write access for lfs lock [rid: %d]", err.UserName, err.RepoID)
}
return fmt.Sprintf("User %s doesn't have read access for lfs lock [rid: %d]", err.UserName, err.RepoID)