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

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

config/locales/de.yml
config/locales/en.yml
config/locales/fr.yml
config/locales/ja.yml
db/migrate/20170418090031_add_view_news_to_all_existing_roles.rb [new file with mode: 0644]
lib/redmine.rb
lib/redmine/default_data/loader.rb
test/fixtures/roles.yml

index 0519dd97614e00eacf05ce6f2f1f47f9b6caff05..99a7c1ddf39f2fc53443cc071d02a874bdc44cd2 100644 (file)
@@ -926,6 +926,7 @@ de:
   permission_manage_files: Dateien verwalten
   permission_manage_issue_relations: Ticket-Beziehungen verwalten
   permission_manage_members: Mitglieder verwalten
+  permission_view_news: News ansehen
   permission_manage_news: News verwalten
   permission_manage_project_activities: Aktivitäten (Zeiterfassung) verwalten
   permission_manage_public_queries: Öffentliche Filter verwalten
index a8eca2dfeb2eee0b316f474e80dd9001120a476c..f2a8cbc0b7bc388efdf257606c06af3b5a9a4bfd 100644 (file)
@@ -497,6 +497,7 @@ en:
   permission_view_time_entries: View spent time
   permission_edit_time_entries: Edit time logs
   permission_edit_own_time_entries: Edit own time logs
+  permission_view_news: View news
   permission_manage_news: Manage news
   permission_comment_news: Comment news
   permission_view_documents: View documents
index 653c49bab7311e31f7dd78c451c7f8154cd08b3f..ce9bb3eda37e143617495142a9407823c0ed0004 100644 (file)
@@ -509,6 +509,7 @@ fr:
   permission_view_time_entries: Voir le temps passé
   permission_edit_time_entries: Modifier les temps passés
   permission_edit_own_time_entries: Modifier son propre temps passé
+  permission_view_news: Voir les annonces
   permission_manage_news: Gérer les annonces
   permission_comment_news: Commenter les annonces
   permission_view_documents: Voir les documents
index a018e72401cb5560a200384f5b47e42fda799b9b..8d1ae6ce1858021ef6fde3469eb824020f8a5ac3 100644 (file)
@@ -427,6 +427,7 @@ ja:
   permission_edit_time_entries: 作業時間の編集
   permission_edit_own_time_entries: 自身が記入した作業時間の編集
   permission_manage_project_activities: 作業分類 (時間管理) の管理
+  permission_view_news: ニュースの閲覧
   permission_manage_news: ニュースの管理
   permission_comment_news: ニュースへのコメント
   permission_view_documents: 文書の閲覧
diff --git a/db/migrate/20170418090031_add_view_news_to_all_existing_roles.rb b/db/migrate/20170418090031_add_view_news_to_all_existing_roles.rb
new file mode 100644 (file)
index 0000000..6f851a1
--- /dev/null
@@ -0,0 +1,9 @@
+class AddViewNewsToAllExistingRoles < ActiveRecord::Migration
+  def up
+    Role.all.each { |role| role.add_permission! :view_news }
+  end
+
+  def down
+    # nothing to revert
+  end
+end
index 6c53cfb19982070b87cef68701a87b128cceea77..729fcb5613cc4c923cb9f2b2dd093ce41a25b255 100644 (file)
@@ -131,7 +131,7 @@ Redmine::AccessControl.map do |map|
   end
 
   map.project_module :news do |map|
-    map.permission :view_news, {:news => [:index, :show]}, :public => true, :read => true
+    map.permission :view_news, {:news => [:index, :show]}, :read => true
     map.permission :manage_news, {:news => [:new, :create, :edit, :update, :destroy], :comments => [:destroy], :attachments => :upload}, :require => :member
     map.permission :comment_news, {:comments => :create}
   end
index 18e7079085fe62146b2c30849f39b897daabceab..680e84199f47d43d1ccc50a425ee8ddb458712c6 100644 (file)
@@ -65,6 +65,7 @@ module Redmine
                                                       :view_calendar,
                                                       :log_time,
                                                       :view_time_entries,
+                                                      :view_news,
                                                       :comment_news,
                                                       :view_documents,
                                                       :view_wiki_pages,
@@ -91,6 +92,7 @@ module Redmine
                                                     :view_calendar,
                                                     :log_time,
                                                     :view_time_entries,
+                                                    :view_news,
                                                     :comment_news,
                                                     :view_documents,
                                                     :view_wiki_pages,
@@ -109,6 +111,7 @@ module Redmine
                                                             :view_gantt,
                                                             :view_calendar,
                                                             :view_time_entries,
+                                                            :view_news,
                                                             :comment_news,
                                                             :view_documents,
                                                             :view_wiki_pages,
@@ -123,6 +126,7 @@ module Redmine
                                                            :view_gantt,
                                                            :view_calendar,
                                                            :view_time_entries,
+                                                           :view_news,
                                                            :view_documents,
                                                            :view_wiki_pages,
                                                            :view_wiki_edits,
index 2365795b3774d924b78b46ac636d18773b963d76..ce7e1b4e7e331c7e9715b97a108c4131713c7e8b 100644 (file)
@@ -36,6 +36,7 @@ roles_001:
     - :view_time_entries
     - :edit_time_entries
     - :delete_time_entries
+    - :view_news
     - :manage_news
     - :comment_news
     - :view_documents
@@ -92,6 +93,7 @@ roles_002:
     - :log_time
     - :view_time_entries
     - :edit_own_time_entries
+    - :view_news
     - :manage_news
     - :comment_news
     - :view_documents
@@ -137,6 +139,7 @@ roles_003:
     - :view_calendar
     - :log_time
     - :view_time_entries
+    - :view_news
     - :manage_news
     - :comment_news
     - :view_documents
@@ -174,6 +177,7 @@ roles_004:
     - :view_calendar
     - :log_time
     - :view_time_entries
+    - :view_news
     - :comment_news
     - :view_documents
     - :view_wiki_pages
@@ -200,6 +204,7 @@ roles_005:
     - :view_gantt
     - :view_calendar
     - :view_time_entries
+    - :view_news
     - :view_documents
     - :view_wiki_pages
     - :view_wiki_edits