2021-04-29 21:17:54 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module HasTimelogsReport
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
include Gitlab::Utils::StrongMemoize
|
|
|
|
|
|
|
|
def timelogs(start_time, end_time)
|
|
|
|
strong_memoize(:timelogs) { timelogs_for(start_time, end_time) }
|
|
|
|
end
|
|
|
|
|
|
|
|
def user_can_access_group_timelogs?(current_user)
|
|
|
|
Ability.allowed?(current_user, :read_group_timelogs, self)
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def timelogs_for(start_time, end_time)
|
2021-06-08 01:23:25 +05:30
|
|
|
Timelog.between_times(start_time, end_time).in_group(self)
|
2021-04-29 21:17:54 +05:30
|
|
|
end
|
|
|
|
end
|