]> source.dussan.org Git - redmine.git/commitdiff
New Permission: View Forum (#4866).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 7 Jun 2017 20:20:22 +0000 (20:20 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 7 Jun 2017 20:20:22 +0000 (20:20 +0000)
Patch by Felix Schäfer.

git-svn-id: http://svn.redmine.org/redmine/trunk@16637 e93f8b46-1217-0410-a6f0-8f06a7374b81

db/migrate/20170419144536_add_view_messages_to_all_existing_roles.rb [new file with mode: 0644]
lib/redmine.rb
lib/redmine/default_data/loader.rb
test/fixtures/roles.yml

diff --git a/db/migrate/20170419144536_add_view_messages_to_all_existing_roles.rb b/db/migrate/20170419144536_add_view_messages_to_all_existing_roles.rb
new file mode 100644 (file)
index 0000000..d010ba4
--- /dev/null
@@ -0,0 +1,9 @@
+class AddViewMessagesToAllExistingRoles < ActiveRecord::Migration
+  def up
+    Role.all.each { |role| role.add_permission! :view_messages }
+  end
+
+  def down
+    # nothing to revert
+  end
+end
index e3ff60fd146e52350c67079da9fb00ad2ce6ce54..6c53cfb19982070b87cef68701a87b128cceea77 100644 (file)
@@ -169,7 +169,7 @@ Redmine::AccessControl.map do |map|
   end
 
   map.project_module :boards do |map|
-    map.permission :view_messages, {:boards => [:index, :show], :messages => [:show]}, :public => true, :read => true
+    map.permission :view_messages, {:boards => [:index, :show], :messages => [:show]}, :read => true
     map.permission :add_messages, {:messages => [:new, :reply, :quote], :attachments => :upload}
     map.permission :edit_messages, {:messages => :edit, :attachments => :upload}, :require => :member
     map.permission :edit_own_messages, {:messages => :edit, :attachments => :upload}, :require => :loggedin
index 0d36dbba8f5ccdc7f98354c185fabd39019821de..18e7079085fe62146b2c30849f39b897daabceab 100644 (file)
@@ -71,6 +71,7 @@ module Redmine
                                                       :view_wiki_edits,
                                                       :edit_wiki_pages,
                                                       :delete_wiki_pages,
+                                                      :view_messages,
                                                       :add_messages,
                                                       :edit_own_messages,
                                                       :view_files,
@@ -94,6 +95,7 @@ module Redmine
                                                     :view_documents,
                                                     :view_wiki_pages,
                                                     :view_wiki_edits,
+                                                    :view_messages,
                                                     :add_messages,
                                                     :edit_own_messages,
                                                     :view_files,
@@ -111,6 +113,7 @@ module Redmine
                                                             :view_documents,
                                                             :view_wiki_pages,
                                                             :view_wiki_edits,
+                                                            :view_messages,
                                                             :add_messages,
                                                             :view_files,
                                                             :browse_repository,
@@ -123,6 +126,7 @@ module Redmine
                                                            :view_documents,
                                                            :view_wiki_pages,
                                                            :view_wiki_edits,
+                                                           :view_messages,
                                                            :view_files,
                                                            :browse_repository,
                                                            :view_changesets]
index 0ed7aa13baf54438c899d111bfc3d7effd9659bb..2365795b3774d924b78b46ac636d18773b963d76 100644 (file)
@@ -50,6 +50,7 @@ roles_001:
     - :protect_wiki_pages
     - :delete_wiki_pages
     - :rename_wiki_pages
+    - :view_messages
     - :add_messages
     - :edit_messages
     - :delete_messages
@@ -102,6 +103,7 @@ roles_002:
     - :edit_wiki_pages
     - :protect_wiki_pages
     - :delete_wiki_pages
+    - :view_messages
     - :add_messages
     - :edit_own_messages
     - :delete_own_messages
@@ -145,6 +147,7 @@ roles_003:
     - :view_wiki_edits
     - :edit_wiki_pages
     - :delete_wiki_pages
+    - :view_messages
     - :add_messages
     - :manage_boards
     - :view_files
@@ -176,6 +179,7 @@ roles_004:
     - :view_wiki_pages
     - :view_wiki_edits
     - :edit_wiki_pages
+    - :view_messages
     - :add_messages
     - :view_files
     - :manage_files
@@ -199,6 +203,7 @@ roles_005:
     - :view_documents
     - :view_wiki_pages
     - :view_wiki_edits
+    - :view_messages
     - :view_files
     - :browse_repository
     - :view_changesets