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

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

index c727d0be5eb2e0766d5feb0853cc220a4f250411..5183393f5b8a83d84f6d3de13e03e24281028e39 100644 (file)
@@ -693,7 +693,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 dca614d77df4a8ca0045dd7125ed2bd2d35077f7..52073ef143e9e6619edab05cfe289928251d3aca 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) }