summaryrefslogtreecommitdiff
path: root/app/helpers/visibility_level_helper.rb
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2017-08-24 17:19:49 -0500
committerMike Greiling <mike@pixelcog.com>2017-08-26 03:30:01 -0500
commit37edce19dd2f006ef2117ca8a9f05398e704a11c (patch)
tree3997f640f8377fd2c90855d202cb19c99a5a9853 /app/helpers/visibility_level_helper.rb
parentaf6968a15859a309cbb93a0327fc1d4be36041bc (diff)
downloadgitlab-ce-37edce19dd2f006ef2117ca8a9f05398e704a11c.tar.gz
recognize instances where group visibility levels are unavailable
Diffstat (limited to 'app/helpers/visibility_level_helper.rb')
-rw-r--r--app/helpers/visibility_level_helper.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/helpers/visibility_level_helper.rb b/app/helpers/visibility_level_helper.rb
index 35755bc149b..ecc554f85d0 100644
--- a/app/helpers/visibility_level_helper.rb
+++ b/app/helpers/visibility_level_helper.rb
@@ -96,6 +96,7 @@ module VisibilityLevelHelper
to: :current_application_settings
def skip_level?(form_model, level)
- form_model.is_a?(Project) && !form_model.visibility_level_allowed?(level)
+ return false unless form_model.respond_to?(:visibility_level_allowed?)
+ !form_model.visibility_level_allowed?(level)
end
end