Sha256: 31baf08129ff63381769c0088e531f47c953b21cf5f953b08d232dc688b0a149

Contents?: true

Size: 911 Bytes

Versions: 4

Compression:

Stored size: 911 Bytes

Contents

class OrganizationAccessMode::Base
  attr_reader :user, :organization

  def initialize(user, organization)
    @user = user
    @organization = organization
  end

  def validate_active!
  end

  def faqs_here?
    organization.faqs.present?
  end

  def submit_solutions_here?
    false
  end

  def resolve_discussions_here?
    false
  end

  def discuss_here?
    organization.forum_enabled? && user.discusser_of?(organization) &&
      user.trusted_as_discusser_in?(organization) && !user.banned_from_forum?
  end

  def show_discussion_element?
    false
  end

  def show_content_element?
    false
  end

  def restore_indicators?(_content)
    false
  end

  def read_only?
    false
  end

  def validate_discuss_here!(_discussion)
    raise Mumuki::Domain::ForbiddenError
  end

  def validate_content_here!(content)
    raise Mumuki::Domain::ForbiddenError unless show_content?(content)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mumuki-domain-9.15.0 app/models/organization_access_mode/base.rb
mumuki-domain-9.14.1 app/models/organization_access_mode/base.rb
mumuki-domain-9.14.0 app/models/organization_access_mode/base.rb
mumuki-domain-9.13.1 app/models/organization_access_mode/base.rb