return
end
@content = @page.content_for_version(params[:version])
- if params[:format] == 'html'
- export = render_to_string :action => 'export', :layout => false
- send_data(export, :type => 'text/html', :filename => "#{@page.title}.html")
- return
- elsif params[:format] == 'txt'
- send_data(@content.text, :type => 'text/plain', :filename => "#{@page.title}.txt")
- return
+ if User.current.allowed_to?(:export_wiki_pages, @project)
+ if params[:format] == 'html'
+ export = render_to_string :action => 'export', :layout => false
+ send_data(export, :type => 'text/html', :filename => "#{@page.title}.html")
+ return
+ elsif params[:format] == 'txt'
+ send_data(@content.text, :type => 'text/plain', :filename => "#{@page.title}.txt")
+ return
+ end
end
- @editable = editable?
+ @editable = editable?
render :action => 'show'
end
@pages_by_parent_id = @pages.group_by(&:parent_id)
# export wiki to a single html file
when 'export'
- @pages = @wiki.pages.find :all, :order => 'title'
- export = render_to_string :action => 'export_multiple', :layout => false
- send_data(export, :type => 'text/html', :filename => "wiki.html")
+ if User.current.allowed_to?(:export_wiki_pages, @project)
+ @pages = @wiki.pages.find :all, :order => 'title'
+ export = render_to_string :action => 'export_multiple', :layout => false
+ send_data(export, :type => 'text/html', :filename => "wiki.html")
+ else
+ redirect_to :action => 'index', :id => @project, :page => nil
+ end
return
else
# requested special page doesn't exist, redirect to default page
<% other_formats_links do |f| %>
<%= f.link_to 'HTML', :url => {:page => @page.title, :version => @content.version} %>
<%= f.link_to 'TXT', :url => {:page => @page.title, :version => @content.version} %>
-<% end %>
+<% end if User.current.allowed_to?(:export_wiki_pages, @project) %>
<% content_for :header_tags do %>
<%= stylesheet_link_tag 'scm' %>
<% unless @pages.empty? %>
<% other_formats_links do |f| %>
<%= f.link_to 'Atom', :url => {:controller => 'projects', :action => 'activity', :id => @project, :show_wiki_edits => 1, :key => User.current.rss_key} %>
- <%= f.link_to 'HTML', :url => {:action => 'special', :page => 'export'} %>
+ <%= f.link_to('HTML', :url => {:action => 'special', :page => 'export'}) if User.current.allowed_to?(:export_wiki_pages, @project) %>
<% end %>
<% end %>
<% unless @pages.empty? %>
<% other_formats_links do |f| %>
<%= f.link_to 'Atom', :url => {:controller => 'projects', :action => 'activity', :id => @project, :show_wiki_edits => 1, :key => User.current.rss_key} %>
- <%= f.link_to 'HTML', :url => {:action => 'special', :page => 'export'} %>
+ <%= f.link_to('HTML', :url => {:action => 'special', :page => 'export'}) if User.current.allowed_to?(:export_wiki_pages, @project) %>
<% end %>
<% end %>
label_close_versions: Close completed versions
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
label_close_versions: Close completed versions
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
label_close_versions: Close completed versions
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
label_close_versions: Close completed versions
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
label_close_versions: Close completed versions
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
label_close_versions: Vollständige Versionen schließen
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
label_close_versions: Close completed versions
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
permission_edit_own_messages: Edit own messages
permission_delete_messages: Delete messages
permission_delete_own_messages: Delete own messages
+ permission_export_wiki_pages: Export wiki pages
project_module_issue_tracking: Issue tracking
project_module_time_tracking: Time tracking
label_close_versions: Cerrar versiones completadas
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
enumeration_system_activity: Sistemako Jarduera
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages\r
label_close_versions: Close completed versions
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
permission_edit_own_messages: Modifier ses propres messages
permission_delete_messages: Supprimer les messages
permission_delete_own_messages: Supprimer ses propres messages
+ permission_export_wiki_pages: Exporter les pages
project_module_issue_tracking: Suivi des demandes
project_module_time_tracking: Suivi du temps passé
label_close_versions: Close completed versions
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
label_close_versions: Close completed versions
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
Are you sure you want to continue?
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
label_close_versions: Close completed versions
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
label_close_versions: Close completed versions
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
label_close_versions: Close completed versions
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
enumeration_doc_categories: 文書カテゴリ
enumeration_activities: 作業分類 (時間トラッキング)
enumeration_system_activity: システム作業分類
+ permission_export_wiki_pages: Export wiki pages
label_close_versions: Close completed versions
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
label_close_versions: Close completed versions
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
label_close_versions: Close completed versions
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
label_close_versions: Close completed versions
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
label_board_sticky: Marcado
label_board_locked: Travado
label_change_log: Registro de alterações
+ permission_export_wiki_pages: Export wiki pages
label_close_versions: Close completed versions
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
label_close_versions: Close completed versions
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
label_close_versions: Закрыть завершенные версии
label_board_sticky: Прикреплена
label_board_locked: Заблокирована
+ permission_export_wiki_pages: Export wiki pages
label_close_versions: Close completed versions
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
label_close_versions: Close completed versions
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
label_close_versions: Close completed versions
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
enumeration_doc_categories: Dokumentkategorier
enumeration_activities: Aktiviteter (tidsuppföljning)
enumeration_system_activity: Systemaktivitet
+ permission_export_wiki_pages: Export wiki pages
label_close_versions: Close completed versions
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
label_close_versions: Close completed versions
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
label_close_versions: Close completed versions
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
label_close_versions: Close completed versions
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
enumeration_doc_categories: 文件分類
enumeration_activities: 活動 (時間追蹤)
enumeration_system_activity: 系統活動
+ permission_export_wiki_pages: Export wiki pages
enumeration_system_activity: 系统活动
label_board_sticky: Sticky
label_board_locked: Locked
+ permission_export_wiki_pages: Export wiki pages
map.permission :rename_wiki_pages, {:wiki => :rename}, :require => :member
map.permission :delete_wiki_pages, {:wiki => :destroy}, :require => :member
map.permission :view_wiki_pages, :wiki => [:index, :special]
+ map.permission :export_wiki_pages, {}
map.permission :view_wiki_edits, :wiki => [:history, :diff, :annotate]
map.permission :edit_wiki_pages, :wiki => [:edit, :preview, :add_attachment]
map.permission :delete_wiki_pages_attachments, {}
- :view_documents
- :manage_documents
- :view_wiki_pages
+ - :export_wiki_pages
- :view_wiki_edits
- :edit_wiki_pages
- :delete_wiki_pages_attachments