user_policy.rb 287 Bytes EditWeb IDE 1 2 3 4 5 6 7 8 9 10 11 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