Project

General

Profile

Feature #4866 » 4866-2.patch

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

View differences:

db/migrate/20170419144536_add_view_messages_to_all_existing_roles.rb
1
class AddViewMessagesToAllExistingRoles < ActiveRecord::Migration
2
  def up
3
    Role.all.each { |role| role.add_permission! :view_messages }
4
  end
5

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

  
171 171
  map.project_module :boards do |map|
172
    map.permission :view_messages, {:boards => [:index, :show], :messages => [:show]}, :public => true, :read => true
172
    map.permission :view_messages, {:boards => [:index, :show], :messages => [:show]}, :read => true
173 173
    map.permission :add_messages, {:messages => [:new, :reply, :quote], :attachments => :upload}
174 174
    map.permission :edit_messages, {:messages => :edit, :attachments => :upload}, :require => :member
175 175
    map.permission :edit_own_messages, {:messages => :edit, :attachments => :upload}, :require => :loggedin
lib/redmine/default_data/loader.rb
71 71
                                                      :view_wiki_edits,
72 72
                                                      :edit_wiki_pages,
73 73
                                                      :delete_wiki_pages,
74
                                                      :view_messages,
74 75
                                                      :add_messages,
75 76
                                                      :edit_own_messages,
76 77
                                                      :view_files,
......
94 95
                                                    :view_documents,
95 96
                                                    :view_wiki_pages,
96 97
                                                    :view_wiki_edits,
98
                                                    :view_messages,
97 99
                                                    :add_messages,
98 100
                                                    :edit_own_messages,
99 101
                                                    :view_files,
......
111 113
                                                            :view_documents,
112 114
                                                            :view_wiki_pages,
113 115
                                                            :view_wiki_edits,
116
                                                            :view_messages,
114 117
                                                            :add_messages,
115 118
                                                            :view_files,
116 119
                                                            :browse_repository,
......
123 126
                                                           :view_documents,
124 127
                                                           :view_wiki_pages,
125 128
                                                           :view_wiki_edits,
129
                                                           :view_messages,
126 130
                                                           :view_files,
127 131
                                                           :browse_repository,
128 132
                                                           :view_changesets]
test/fixtures/roles.yml
50 50
    - :protect_wiki_pages
51 51
    - :delete_wiki_pages
52 52
    - :rename_wiki_pages
53
    - :view_messages
53 54
    - :add_messages
54 55
    - :edit_messages
55 56
    - :delete_messages
......
102 103
    - :edit_wiki_pages
103 104
    - :protect_wiki_pages
104 105
    - :delete_wiki_pages
106
    - :view_messages
105 107
    - :add_messages
106 108
    - :edit_own_messages
107 109
    - :delete_own_messages
......
145 147
    - :view_wiki_edits
146 148
    - :edit_wiki_pages
147 149
    - :delete_wiki_pages
150
    - :view_messages
148 151
    - :add_messages
149 152
    - :manage_boards
150 153
    - :view_files
......
176 179
    - :view_wiki_pages
177 180
    - :view_wiki_edits
178 181
    - :edit_wiki_pages
182
    - :view_messages
179 183
    - :add_messages
180 184
    - :view_files
181 185
    - :manage_files
......
199 203
    - :view_documents
200 204
    - :view_wiki_pages
201 205
    - :view_wiki_edits
206
    - :view_messages
202 207
    - :view_files
203 208
    - :browse_repository
204 209
    - :view_changesets
(2-2/2)