Class: AccessRequestsFinder

Inherits:
Object
  • Object
show all
Defined in:
app/finders/access_requests_finder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source) ⇒ AccessRequestsFinder

Arguments:

source - a Group or Project

8
9
10
# File 'app/finders/access_requests_finder.rb', line 8

def initialize(source)
  @source = source
end

Instance Attribute Details

#sourceObject

Returns the value of attribute source


4
5
6
# File 'app/finders/access_requests_finder.rb', line 4

def source
  @source
end

Instance Method Details

#execute(*args) ⇒ Object


12
13
14
15
16
# File 'app/finders/access_requests_finder.rb', line 12

def execute(*args)
  execute!(*args)
rescue Gitlab::Access::AccessDeniedError
  []
end

#execute!(current_user) ⇒ Object


18
19
20
21
22
# File 'app/finders/access_requests_finder.rb', line 18

def execute!(current_user)
  raise Gitlab::Access::AccessDeniedError unless can_see_access_requests?(current_user)

  source.requesters
end