Sha256: 82cbb05a960dc654f20a619f189ab92fbb2bcf1971b6669eedea3f5015aacc1e

Contents?: true

Size: 1.16 KB

Versions: 16

Compression:

Stored size: 1.16 KB

Contents

module DmForum
  module PermittedParams

    #------------------------------------------------------------------------------
    def forum_site_params
      params.require(:forum_site).permit! if can? :manage_forums, :all
    end

    #------------------------------------------------------------------------------
    def forum_category_params
      params.require(:forum_category).permit! if can? :manage_forums, :all
    end

    #------------------------------------------------------------------------------
    def forum_params
      params.require(:forum).permit! if can? :manage_forums, :all
    end

    #------------------------------------------------------------------------------
    def forum_topic_params
      if can? :manage_forums, :all
        params.require(:forum_topic).permit!
      else
        params.require(:forum_topic).permit(:title, :body)
      end
    end

    #------------------------------------------------------------------------------
    def forum_comment_params
      if can? :manage_forums, :all
        params.require(:forum_comment).permit!
      else
        params.require(:forum_comment).permit(:title, :body)
      end
    end

  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
dm_forum-4.2.3.10 app/models/dm_forum/permitted_params.rb
dm_forum-4.2.3.9 app/models/dm_forum/permitted_params.rb
dm_forum-4.2.3.8 app/models/dm_forum/permitted_params.rb
dm_forum-4.2.3.7 app/models/dm_forum/permitted_params.rb
dm_forum-4.2.3.6 app/models/dm_forum/permitted_params.rb
dm_forum-4.2.3.5 app/models/dm_forum/permitted_params.rb
dm_forum-4.2.3.4 app/models/dm_forum/permitted_params.rb
dm_forum-4.2.3.3 app/models/dm_forum/permitted_params.rb
dm_forum-4.2.3.2 app/models/dm_forum/permitted_params.rb
dm_forum-4.2.3.1 app/models/dm_forum/permitted_params.rb
dm_forum-4.2.3 app/models/dm_forum/permitted_params.rb
dm_forum-4.2.2.3 app/models/dm_forum/permitted_params.rb
dm_forum-4.2.2.2 app/models/dm_forum/permitted_params.rb
dm_forum-4.2.2.1 app/models/dm_forum/permitted_params.rb
dm_forum-4.2.2 app/models/dm_forum/permitted_params.rb
dm_forum-4.2.1.5 app/models/dm_forum/permitted_params.rb