Class: Gitlab::DeployKeyAccess

Inherits:
UserAccess show all
Defined in:
lib/gitlab/deploy_key_access.rb

Instance Attribute Summary

Attributes inherited from UserAccess

#container, #push_ability, #user

Attributes included from Cache::RequestCache

#request_cache_key_block

Instance Method Summary collapse

Methods inherited from UserAccess

#allowed?, #can_do_action?, #can_update_branch?, #cannot_do_action?

Methods included from Cache::RequestCache

extended, #request_cache, #request_cache_key

Constructor Details

#initialize(deploy_key, container: nil) ⇒ DeployKeyAccess

Returns a new instance of DeployKeyAccess.



5
6
7
8
9
# File 'lib/gitlab/deploy_key_access.rb', line 5

def initialize(deploy_key, container: nil)
  @deploy_key = deploy_key
  @user = deploy_key.user
  @container = container
end

Instance Method Details

#can_push_for_ref?(ref) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/gitlab/deploy_key_access.rb', line 11

def can_push_for_ref?(ref)
  can_push_to_branch?(ref)
end