Project

General

Profile

Feature #7068 » 7068-3.patch

Felix Schäfer, 2017-04-21 11:43

View differences:

config/locales/de.yml
926 926
  permission_manage_files: Dateien verwalten
927 927
  permission_manage_issue_relations: Ticket-Beziehungen verwalten
928 928
  permission_manage_members: Mitglieder verwalten
929
  permission_view_news: News ansehen
929 930
  permission_manage_news: News verwalten
930 931
  permission_manage_project_activities: Aktivitäten (Zeiterfassung) verwalten
931 932
  permission_manage_public_queries: Öffentliche Filter verwalten
config/locales/en.yml
497 497
  permission_view_time_entries: View spent time
498 498
  permission_edit_time_entries: Edit time logs
499 499
  permission_edit_own_time_entries: Edit own time logs
500
  permission_view_news: View news
500 501
  permission_manage_news: Manage news
501 502
  permission_comment_news: Comment news
502 503
  permission_view_documents: View documents
config/locales/fr.yml
509 509
  permission_view_time_entries: Voir le temps passé
510 510
  permission_edit_time_entries: Modifier les temps passés
511 511
  permission_edit_own_time_entries: Modifier son propre temps passé
512
  permission_view_news: Voir les annonces
512 513
  permission_manage_news: Gérer les annonces
513 514
  permission_comment_news: Commenter les annonces
514 515
  permission_view_documents: Voir les documents
config/locales/ja.yml
427 427
  permission_edit_time_entries: 作業時間の編集
428 428
  permission_edit_own_time_entries: 自身が記入した作業時間の編集
429 429
  permission_manage_project_activities: 作業分類 (時間管理) の管理
430
  permission_view_news: ニュースの閲覧
430 431
  permission_manage_news: ニュースの管理
431 432
  permission_comment_news: ニュースへのコメント
432 433
  permission_view_documents: 文書の閲覧
db/migrate/20170418090031_add_view_news_to_all_existing_roles.rb
1
class AddViewNewsToAllExistingRoles < ActiveRecord::Migration
2
  def up
3
    Role.all.each { |role| role.add_permission! :view_news }
4
  end
5

  
6
  def down
7
    # nothing to revert
8
  end
9
end
lib/redmine.rb
131 131
  end
132 132

  
133 133
  map.project_module :news do |map|
134
    map.permission :view_news, {:news => [:index, :show]}, :public => true, :read => true
134
    map.permission :view_news, {:news => [:index, :show]}, :read => true
135 135
    map.permission :manage_news, {:news => [:new, :create, :edit, :update, :destroy], :comments => [:destroy], :attachments => :upload}, :require => :member
136 136
    map.permission :comment_news, {:comments => :create}
137 137
  end
lib/redmine/default_data/loader.rb
65 65
                                                      :view_calendar,
66 66
                                                      :log_time,
67 67
                                                      :view_time_entries,
68
                                                      :view_news,
68 69
                                                      :comment_news,
69 70
                                                      :view_documents,
70 71
                                                      :view_wiki_pages,
......
90 91
                                                    :view_calendar,
91 92
                                                    :log_time,
92 93
                                                    :view_time_entries,
94
                                                    :view_news,
93 95
                                                    :comment_news,
94 96
                                                    :view_documents,
95 97
                                                    :view_wiki_pages,
......
107 109
                                                            :view_gantt,
108 110
                                                            :view_calendar,
109 111
                                                            :view_time_entries,
112
                                                            :view_news,
110 113
                                                            :comment_news,
111 114
                                                            :view_documents,
112 115
                                                            :view_wiki_pages,
......
120 123
                                                           :view_gantt,
121 124
                                                           :view_calendar,
122 125
                                                           :view_time_entries,
126
                                                           :view_news,
123 127
                                                           :view_documents,
124 128
                                                           :view_wiki_pages,
125 129
                                                           :view_wiki_edits,
test/fixtures/roles.yml
36 36
    - :view_time_entries
37 37
    - :edit_time_entries
38 38
    - :delete_time_entries
39
    - :view_news
39 40
    - :manage_news
40 41
    - :comment_news
41 42
    - :view_documents
......
91 92
    - :log_time
92 93
    - :view_time_entries
93 94
    - :edit_own_time_entries
95
    - :view_news
94 96
    - :manage_news
95 97
    - :comment_news
96 98
    - :view_documents
......
135 137
    - :view_calendar
136 138
    - :log_time
137 139
    - :view_time_entries
140
    - :view_news
138 141
    - :manage_news
139 142
    - :comment_news
140 143
    - :view_documents
......
171 174
    - :view_calendar
172 175
    - :log_time
173 176
    - :view_time_entries
177
    - :view_news
174 178
    - :comment_news
175 179
    - :view_documents
176 180
    - :view_wiki_pages
......
196 200
    - :view_gantt
197 201
    - :view_calendar
198 202
    - :view_time_entries
203
    - :view_news
199 204
    - :view_documents
200 205
    - :view_wiki_pages
201 206
    - :view_wiki_edits
(2-2/2)