Sha256: f021da94f7af1fada354e69cda00dbfc85f598b0721246bd030746f7cb825bd7

Contents?: true

Size: 841 Bytes

Versions: 13

Compression:

Stored size: 841 Bytes

Contents

# frozen_string_literal: true
module Thredded
  class NullUser
    include ::Thredded::UserPermissions::Read::All
    include ::Thredded::UserPermissions::Write::None
    include ::Thredded::UserPermissions::Message::ReadersOfWriteableBoards
    include ::Thredded::UserPermissions::Moderate::None
    include ::Thredded::UserPermissions::Admin::None

    def thredded_private_topics
      Thredded::PrivateTopic.none
    end

    def id
      nil
    end

    def name
      I18n.t('thredded.null_user_name')
    end

    def to_s
      name
    end

    def valid?
      false
    end

    def thredded_anonymous?
      true
    end

    def thredded_user_detail
      Thredded::UserDetail.new
    end

    def thredded_user_preference
      Thredded::UserPreference.new
    end

    def thredded_display_name
      to_s
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
thredded-0.12.1 app/models/thredded/null_user.rb
thredded-0.12.0 app/models/thredded/null_user.rb
thredded-0.11.1 app/models/thredded/null_user.rb
thredded-0.11.0 app/models/thredded/null_user.rb
thredded-0.10.1 app/models/thredded/null_user.rb
thredded-0.10.0 app/models/thredded/null_user.rb
thredded-0.9.4 app/models/thredded/null_user.rb
thredded-0.9.3 app/models/thredded/null_user.rb
thredded-0.9.2 app/models/thredded/null_user.rb
thredded-0.9.1 app/models/thredded/null_user.rb
thredded-0.8.4 app/models/thredded/null_user.rb
thredded-0.8.2 app/models/thredded/null_user.rb
thredded-0.7.0 app/models/thredded/null_user.rb