summaryrefslogtreecommitdiff
path: root/lib/feature.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/feature.rb')
-rw-r--r--lib/feature.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/feature.rb b/lib/feature.rb
index 12b4ef07dd6..47fee23c7ea 100644
--- a/lib/feature.rb
+++ b/lib/feature.rb
@@ -245,11 +245,11 @@ class Feature
end
def gate_specified?
- %i(user project group feature_group).any? { |key| params.key?(key) }
+ %i(user project group feature_group namespace).any? { |key| params.key?(key) }
end
def targets
- [feature_group, user, project, group].compact
+ [feature_group, user, project, group, namespace].compact
end
private
@@ -279,6 +279,13 @@ class Feature
Group.find_by_full_path(params[:group])
end
+
+ def namespace
+ return unless params.key?(:namespace)
+
+ # We are interested in Group or UserNamespace
+ Namespace.without_project_namespaces.find_by_full_path(params[:namespace])
+ end
end
end