Skip to content

Commit 4808e6c

Browse files
committed
Migrate to AccessMode type
1 parent 7f856e7 commit 4808e6c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

models/error.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ func (err ErrLFSLockNotExist) Error() string {
534534
type ErrLFSUnauthorizedAction struct {
535535
RepoID int64
536536
UserName string
537-
RequireWrite bool
537+
Mode AccessMode
538538
}
539539

540540
// IsErrLFSUnauthorizedAction checks if an error is a ErrLFSUnauthorizedAction.
@@ -544,7 +544,7 @@ func IsErrLFSUnauthorizedAction(err error) bool {
544544
}
545545

546546
func (err ErrLFSUnauthorizedAction) Error() string {
547-
if err.RequireWrite {
547+
if err.Mode == AccessModeWrite {
548548
return fmt.Sprintf("User %s doesn't have write access for lfs lock [rid: %d]", err.UserName, err.RepoID)
549549
}
550550
return fmt.Sprintf("User %s doesn't have read access for lfs lock [rid: %d]", err.UserName, err.RepoID)

0 commit comments

Comments
 (0)