blob: 7f4c597fddd4f8d9d9c950077759351cc9b4c649 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# frozen_string_literal: true
module FeatureGroups
class GitlabTeamMembers
GITLAB_COM_GROUP_ID = 6543
class << self
def enabled?(thing)
return false unless Gitlab.com?
team_member?(thing)
end
private
def team_member?(thing)
thing.is_a?(::User) && gitlab_com_member_ids.include?(thing.id)
end
def gitlab_com
@gitlab_com ||= ::Group.find(GITLAB_COM_GROUP_ID)
end
def gitlab_com_member_ids
Rails.cache.fetch("gitlab_team_members", expires_in: 1.hour) do
gitlab_com.members.pluck_user_ids.to_set
end
end
end
end
end
|