gitlab-org--gitlab-foss/app/policies/user_policy.rb

12 lines
287 B
Ruby
Raw Normal View History

2016-08-18 12:59:17 -04:00
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