gitlab-org--gitlab-foss/app/policies/user_policy.rb
http://jneen.net/ a340829c42 port UserPolicy
2016-08-30 11:39:22 -07:00

11 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