Class: Gitlab::Dangerfiles::Capability::Tooling

Inherits:
Gitlab::Dangerfiles::Capability show all
Defined in:
lib/gitlab/dangerfiles/capability.rb

Instance Attribute Summary

Attributes inherited from Gitlab::Dangerfiles::CapabilityStruct

#category, #kind, #labels, #project

Instance Method Summary collapse

Methods inherited from Gitlab::Dangerfiles::Capability

for

Instance Method Details

#has_capability?(teammate) ⇒ Boolean

Returns:

  • (Boolean)


52
53
54
55
56
57
58
59
60
# File 'lib/gitlab/dangerfiles/capability.rb', line 52

def has_capability?(teammate)
  if super
    true
  elsif %i[trainee_maintainer maintainer].include?(kind)
    false
  else # fallback to backend reviewer
    teammate.capabilities(project).include?("#{kind} backend")
  end
end