debian-mirror-gitlab/app/policies/user_policy.rb
2016-09-29 09:46:39 +05:30

12 lines
287 B
Ruby

class UserPolicy < BasePolicy
include Gitlab::CurrentSettings
def rules
can! :read_user if @user || !restricted_public_level?
end
def restricted_public_level?
current_application_settings.restricted_visibility_levels.include?(Gitlab::VisibilityLevel::PUBLIC)
end
end