@@ -3,16 +3,16 class SetDocAndFilesNotifications < ActiveRecord::Migration | |||||
3 | class Permission < ActiveRecord::Base; end |
|
3 | class Permission < ActiveRecord::Base; end | |
4 |
|
4 | |||
5 | def self.up |
|
5 | def self.up | |
6 |
Permission. |
|
6 | Permission.where(:controller => "projects", :action => "add_file").each {|p| p.update_attribute(:mail_option, true)} | |
7 |
Permission. |
|
7 | Permission.where(:controller => "projects", :action => "add_document").each {|p| p.update_attribute(:mail_option, true)} | |
8 |
Permission. |
|
8 | Permission.where(:controller => "documents", :action => "add_attachment").each {|p| p.update_attribute(:mail_option, true)} | |
9 |
Permission. |
|
9 | Permission.where(:controller => "issues", :action => "add_attachment").each {|p| p.update_attribute(:mail_option, true)} | |
10 | end |
|
10 | end | |
11 |
|
11 | |||
12 | def self.down |
|
12 | def self.down | |
13 |
Permission. |
|
13 | Permission.where(:controller => "projects", :action => "add_file").each {|p| p.update_attribute(:mail_option, false)} | |
14 |
Permission. |
|
14 | Permission.where(:controller => "projects", :action => "add_document").each {|p| p.update_attribute(:mail_option, false)} | |
15 |
Permission. |
|
15 | Permission.where(:controller => "documents", :action => "add_attachment").each {|p| p.update_attribute(:mail_option, false)} | |
16 |
Permission. |
|
16 | Permission.where(:controller => "issues", :action => "add_attachment").each {|p| p.update_attribute(:mail_option, false)} | |
17 | end |
|
17 | end | |
18 | end |
|
18 | end |
@@ -7,6 +7,6 class AddSearchPermission < ActiveRecord::Migration | |||||
7 | end |
|
7 | end | |
8 |
|
8 | |||
9 | def self.down |
|
9 | def self.down | |
10 |
Permission. |
|
10 | Permission.where(:controller => "projects", :action => "search").each {|p| p.destroy} | |
11 | end |
|
11 | end | |
12 | end |
|
12 | end |
@@ -7,6 +7,6 class AddProjectsFeedsPermissions < ActiveRecord::Migration | |||||
7 | end |
|
7 | end | |
8 |
|
8 | |||
9 | def self.down |
|
9 | def self.down | |
10 |
Permission. |
|
10 | Permission.where(:controller => "projects", :action => "feeds").each {|p| p.destroy} | |
11 | end |
|
11 | end | |
12 | end |
|
12 | end |
@@ -7,6 +7,6 class AddTimelogPermissions < ActiveRecord::Migration | |||||
7 | end |
|
7 | end | |
8 |
|
8 | |||
9 | def self.down |
|
9 | def self.down | |
10 | Permission.find_by_controller_and_action('timelog', 'edit').destroy |
|
10 | Permission.where(:controller => "timelog", :action => "edit").each {|p| p.destroy} | |
11 | end |
|
11 | end | |
12 | end |
|
12 | end |
@@ -8,7 +8,7 class AddRelationsPermissions < ActiveRecord::Migration | |||||
8 | end |
|
8 | end | |
9 |
|
9 | |||
10 | def self.down |
|
10 | def self.down | |
11 |
Permission. |
|
11 | Permission.where(:controller => "issue_relations", :action => "new").each {|p| p.destroy} | |
12 |
Permission. |
|
12 | Permission.where(:controller => "issue_relations", :action => "destroy").each {|p| p.destroy} | |
13 | end |
|
13 | end | |
14 | end |
|
14 | end |
@@ -9,8 +9,8 class AddBoardsPermissions < ActiveRecord::Migration | |||||
9 | end |
|
9 | end | |
10 |
|
10 | |||
11 | def self.down |
|
11 | def self.down | |
12 |
Permission. |
|
12 | Permission.where(:controller => "boards", :action => "new").each {|p| p.destroy} | |
13 |
Permission. |
|
13 | Permission.where(:controller => "boards", :action => "edit").each {|p| p.destroy} | |
14 |
Permission. |
|
14 | Permission.where(:controller => "boards", :action => "destroy").each {|p| p.destroy} | |
15 | end |
|
15 | end | |
16 | end |
|
16 | end |
@@ -7,6 +7,6 class AddWikiDestroyPagePermission < ActiveRecord::Migration | |||||
7 | end |
|
7 | end | |
8 |
|
8 | |||
9 | def self.down |
|
9 | def self.down | |
10 |
Permission. |
|
10 | Permission.where(:controller => "wiki", :action => "destroy").each {|p| p.destroy} | |
11 | end |
|
11 | end | |
12 | end |
|
12 | end |
@@ -8,7 +8,7 class AddWikiAttachmentsPermissions < ActiveRecord::Migration | |||||
8 | end |
|
8 | end | |
9 |
|
9 | |||
10 | def self.down |
|
10 | def self.down | |
11 |
Permission. |
|
11 | Permission.where(:controller => "wiki", :action => "add_attachment").each {|p| p.destroy} | |
12 |
Permission. |
|
12 | Permission.where(:controller => "wiki", :action => "destroy_attachment").each {|p| p.destroy} | |
13 | end |
|
13 | end | |
14 | end |
|
14 | end |
@@ -7,6 +7,6 class AddRepositoriesChangesPermission < ActiveRecord::Migration | |||||
7 | end |
|
7 | end | |
8 |
|
8 | |||
9 | def self.down |
|
9 | def self.down | |
10 |
Permission. |
|
10 | Permission.where(:controller => "repositories", :action => "changes").each {|p| p.destroy} | |
11 | end |
|
11 | end | |
12 | end |
|
12 | end |
General Comments 0
You need to be logged in to leave comments.
Login now