Commit 3c439888 authored by Jeroen van Baarsen's avatar Jeroen van Baarsen

Removed some constant allready defined warnings

Signed-off-by: default avatarJeroen van Baarsen <jeroenvanbaarsen@gmail.com>
parent de582ab3
module Gitlab module Gitlab
class Theme class Theme
BASIC = 1 BASIC = 1 unless const_defined?(:BASIC)
MARS = 2 MARS = 2 unless const_defined?(:MARS)
MODERN = 3 MODERN = 3 unless const_defined?(:MODERN)
GRAY = 4 GRAY = 4 unless const_defined?(:GRAY)
COLOR = 5 COLOR = 5 unless const_defined?(:COLOR)
def self.css_class_by_id(id) def self.css_class_by_id(id)
themes = { themes = {
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
# #
module Gitlab module Gitlab
module VisibilityLevel module VisibilityLevel
PRIVATE = 0 PRIVATE = 0 unless const_defined?(:PRIVATE)
INTERNAL = 10 INTERNAL = 10 unless const_defined?(:INTERNAL)
PUBLIC = 20 PUBLIC = 20 unless const_defined?(:PUBLIC)
class << self class << self
def values def values
...@@ -21,7 +21,7 @@ module Gitlab ...@@ -21,7 +21,7 @@ module Gitlab
'Public' => PUBLIC 'Public' => PUBLIC
} }
end end
def allowed_for?(user, level) def allowed_for?(user, level)
user.is_admin? || !Gitlab.config.gitlab.restricted_visibility_levels.include?(level) user.is_admin? || !Gitlab.config.gitlab.restricted_visibility_levels.include?(level)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment