Sha256: cdb53705025706ae369dba2b705c3b58d5d05fc126a5ed188c5c5dc6592539b2
Contents?: true
Size: 798 Bytes
Versions: 12
Compression:
Stored size: 798 Bytes
Contents
module Hyrax class HomepagePresenter attr_reader :current_ability, :collections def initialize(current_ability, collections) @current_ability = current_ability @collections = collections end # @return [Boolean] If the current user is a guest and the display_share_button_when_not_logged_in? # is activated, then return true. Otherwise return true if the signed in # user has permission to create at least one kind of work. def display_share_button? (user_unregistered? && Hyrax.config.display_share_button_when_not_logged_in?) || current_ability.can_create_any_work? end private def user_unregistered? current_ability.current_user.new_record? || current_ability.current_user.guest? end end end
Version data entries
12 entries across 12 versions & 1 rubygems