Sha256: 7d3a8fb17aa2e961da59164526880dd2c0f25e9f0dab3419b358cd423b886f09
Contents?: true
Size: 509 Bytes
Versions: 17
Compression:
Stored size: 509 Bytes
Contents
# frozen_string_literal: true module Thredded class PrivateTopicPolicy # @param user [Thredded.user_class] # @param private_topic [Thredded::PrivateTopic] def initialize(user, private_topic) @private_topic = private_topic @user = user end def create? !@user.thredded_anonymous? && !@user.thredded_user_detail.blocked? end def read? @private_topic.users.include?(@user) end def update? @user.id == @private_topic.user_id end end end
Version data entries
17 entries across 17 versions & 1 rubygems