Sha256: e0a1cdc9eed0c75aef085b139dcf0bd3402db3d6ddfd23da749b014c6c870aad
Contents?: true
Size: 807 Bytes
Versions: 20
Compression:
Stored size: 807 Bytes
Contents
# frozen_string_literal: true module Thredded module UserPermissions module Moderate module IfModeratorColumnTrue extend ActiveSupport::Concern # @return [ActiveRecord::Relation<Thredded::Messageboard>] messageboards that the user can moderate def thredded_can_moderate_messageboards send(Thredded.moderator_column) ? Thredded::Messageboard.all : Thredded::Messageboard.none end # @param [Thredded::Messageboard] messageboard # @return [Boolean] Whether the user can moderate the given messageboard. def thredded_can_moderate_messageboard?(messageboard) scope = thredded_can_moderate_messageboards scope == Thredded::Messageboard.all || scope.include?(messageboard) end end end end end
Version data entries
20 entries across 20 versions & 1 rubygems