diff options
Diffstat (limited to 'app/models/deploy_key.rb')
-rw-r--r-- | app/models/deploy_key.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/deploy_key.rb b/app/models/deploy_key.rb index 503398f5cca..aaacbd28470 100644 --- a/app/models/deploy_key.rb +++ b/app/models/deploy_key.rb @@ -21,7 +21,11 @@ class DeployKey < Key self.private? end + def has_access_to?(project) + projects.include?(project) + end + def can_push_to?(project) - can_push? && projects.include?(project) + can_push? && has_access_to?(project) end end |