Sha256: fb598cb0ca06e701d89d937066e3072b35db6f948614a68f96783e83780b6d9d
Contents?: true
Size: 824 Bytes
Versions: 1
Compression:
Stored size: 824 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 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
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
mumuki-domain-9.13.0 | app/models/organization_access_mode/base.rb |