mirror of
https://github.com/meineerde/redmine.git
synced 2026-03-16 14:08:13 +00:00
* new methods to add/remove rights in app/models/role.rb * some unit tests * add write check in Redmine.pm To keep compatibility migration add write rights to non builtin roles but default clean install give write access only to manager and developer, not to reporter. git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1791 e93f8b46-1217-0410-a6f0-8f06a7374b81
15 lines
320 B
Ruby
15 lines
320 B
Ruby
class AddRepositoryWriteAccess < ActiveRecord::Migration
|
|
|
|
def self.up
|
|
Role.find(:all).select { |r| not r.builtin? }.each do |r|
|
|
r.add_permission!(:commit_access)
|
|
end
|
|
end
|
|
|
|
def self.down
|
|
Role.find(:all).select { |r| not r.builtin? }.each do |r|
|
|
r.remove_permission!(:commit_access)
|
|
end
|
|
end
|
|
end
|