Sha256: 3df43de11d65852b4fbc7b115b604ff9094afb52eef0a63c82c44402cb7f10a9

Contents?: true

Size: 744 Bytes

Versions: 11

Compression:

Stored size: 744 Bytes

Contents

module RailsConnector
  #
  # This module contains a helper that can be used to build a table of contents of an object.
  #
  # @api public
  module TableOfContentsHelper
    #
    # The <tt>table_of_contents</tt> helper method gets an object as argument and returns an array,
    # which can be used as the table of contents of the given object.
    #
    # The returned array consists of the child objects of the given object.
    # The array is sorted according to the configured sort order and the sort keys.
    # It also contains only objects which the current user is permitted to view.
    #
    # @api public
    def table_of_contents(obj)
      obj.sorted_toclist.reject { |o| !o.permitted_for_user?(current_user) }
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
infopark_fiona_connector-7.0.1.6.1.6.rc4 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_fiona_connector-7.0.1.6.1.6.rc3 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_fiona_connector-7.0.1.6.1.6.rc2 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_fiona_connector-7.0.1.6.1.6.rc1 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_fiona_connector-7.0.1.5.2.7.rc1 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_fiona_connector-7.0.1.5.2.4.rc2 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_fiona_connector-7.0.1.5.2.4.rc1 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_fiona_connector-7.0.1.5.2.3.rc8 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_fiona_connector-7.0.1.5.2.3.rc7 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_fiona_connector-7.0.1.5.2.3.rc6 app/helpers/rails_connector/table_of_contents_helper.rb
infopark_fiona_connector-7.0.1.5.2.3.rc5 app/helpers/rails_connector/table_of_contents_helper.rb