Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-04-07 15:10:21 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-04-07 15:10:21 +0300
commit630c555b11c0fc64d3f0c1ec13b314e2efe3f7ee (patch)
tree5873240ec56a19ddb3794154b0efb48efeab73d3 /app/models/group.rb
parentf6f4bc2bc0f369b0837f01c45c15421f7f3868a3 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/group.rb')
-rw-r--r--app/models/group.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/models/group.rb b/app/models/group.rb
index 02e4e91da23..ff794472eb7 100644
--- a/app/models/group.rb
+++ b/app/models/group.rb
@@ -106,6 +106,7 @@ class Group < Namespace
has_one :crm_settings, class_name: 'Group::CrmSettings', inverse_of: :group
accepts_nested_attributes_for :variables, allow_destroy: true
+ accepts_nested_attributes_for :group_feature, update_only: true
validate :visibility_level_allowed_by_projects
validate :visibility_level_allowed_by_sub_groups
@@ -835,6 +836,17 @@ class Group < Namespace
end
end
+ # Check for enabled features, similar to `Project#feature_available?`
+ # NOTE: We still want to keep this after removing `Namespace#feature_available?`.
+ override :feature_available?
+ def feature_available?(feature, user = nil)
+ if ::Groups::FeatureSetting.available_features.include?(feature)
+ group_feature.feature_available?(feature, user) # rubocop:disable Gitlab/FeatureAvailableUsage
+ else
+ super
+ end
+ end
+
private
def max_member_access(user_ids)