]> source.dussan.org Git - redmine.git/commitdiff
Merged r16283 (#23793).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 29 Jan 2017 10:44:51 +0000 (10:44 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 29 Jan 2017 10:44:51 +0000 (10:44 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/3.2-stable@16301 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb
test/fixtures/wikis.yml
test/unit/helpers/application_helper_test.rb

index 0c937d30f8e71acfff9f871242f36d5f2b5ad2fb..8966e949bd020aad199cabfe87c6a62bd63d1383 100644 (file)
@@ -674,7 +674,7 @@ module ApplicationHelper
           title ||= identifier if page.blank?
         end
 
-        if link_project && link_project.wiki
+        if link_project && link_project.wiki && User.current.allowed_to?(:view_wiki_pages, link_project)
           # extract anchor
           anchor = nil
           if page =~ /^(.+?)\#(.+)$/
index 7254fe687c06a665d07b9f7daf604c2dd415afdf..56910cbbe2974496759c5a6406c1d5881848828f 100644 (file)
@@ -9,3 +9,8 @@ wikis_002:
   start_page: Start page
   project_id: 2
   id: 2
+wikis_005:
+  status: 1
+  start_page: Wiki
+  project_id: 5
+  id: 5
index 030ecb3605b1a80c3669deadca51d58c7e317b3b..98766839630de2c82b2c1207618d8c975ac6819f 100644 (file)
@@ -665,6 +665,7 @@ RAW
   end
 
   def test_wiki_links
+    User.current = User.find_by_login('jsmith')
     russian_eacape = CGI.escape(@russian_test)
     to_test = {
       '[[CookBook documentation]]' =>
@@ -746,6 +747,9 @@ RAW
       # project does not exist
       '[[unknowproject:Start]]' => '[[unknowproject:Start]]',
       '[[unknowproject:Start|Page title]]' => '[[unknowproject:Start|Page title]]',
+      # missing permission to view wiki in project
+      '[[private-child:]]' => '[[private-child:]]',
+      '[[private-child:Wiki]]' => '[[private-child:Wiki]]',
     }
     @project = Project.find(1)
     to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) }