diff options
Diffstat (limited to 'models/ssh_key.go')
-rw-r--r-- | models/ssh_key.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/models/ssh_key.go b/models/ssh_key.go index 5d046c0201..b7dd81b49b 100644 --- a/models/ssh_key.go +++ b/models/ssh_key.go @@ -807,10 +807,10 @@ func DeleteDeployKey(doer *User, id int64) error { if err != nil { return fmt.Errorf("GetRepositoryByID: %v", err) } - yes, err := HasAccess(doer.ID, repo, AccessModeAdmin) + has, err := IsUserRepoAdmin(repo, doer) if err != nil { - return fmt.Errorf("HasAccess: %v", err) - } else if !yes { + return fmt.Errorf("GetUserRepoPermission: %v", err) + } else if !has { return ErrKeyAccessDenied{doer.ID, key.ID, "deploy"} } } |