diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-09 00:09:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-09 00:09:52 +0300 |
commit | 81c0f29ad962733b0750bdab2d3250e2c796a578 (patch) | |
tree | 42d31d9c48d156849c87aee7f4c3c494d2ca6260 /app/models/group.rb | |
parent | 842ac3526cba09feb4b9ccefd0aeeb6edc02035d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/group.rb')
-rw-r--r-- | app/models/group.rb | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/app/models/group.rb b/app/models/group.rb index ff794472eb7..92f75149204 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -828,12 +828,7 @@ class Group < Namespace end def work_items_feature_flag_enabled? - actors = [root_ancestor] - actors << self if root_ancestor != self - - actors.any? do |actor| - Feature.enabled?(:work_items, actor, default_enabled: :yaml) - end + feature_flag_enabled_for_self_or_ancestor?(:work_items) end # Check for enabled features, similar to `Project#feature_available?` @@ -849,6 +844,15 @@ class Group < Namespace private + def feature_flag_enabled_for_self_or_ancestor?(feature_flag) + actors = [root_ancestor] + actors << self if root_ancestor != self + + actors.any? do |actor| + ::Feature.enabled?(feature_flag, actor, default_enabled: :yaml) + end + end + def max_member_access(user_ids) Gitlab::SafeRequestLoader.execute(resource_key: max_member_access_for_resource_key(User), resource_ids: user_ids, |