summaryrefslogtreecommitdiffstats
path: root/db/migrate/062_insert_builtin_roles.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-08-29 16:52:35 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-08-29 16:52:35 +0000
commit603e11d7a5aa62f923e7b013cac6c66462131232 (patch)
treefbbb204d2b92b5a87b787d56fe3f9c62cc3f259b /db/migrate/062_insert_builtin_roles.rb
parent8da5bad29516be6cbe1bc52e78837ac1ec292026 (diff)
downloadredmine-603e11d7a5aa62f923e7b013cac6c66462131232.tar.gz
redmine-603e11d7a5aa62f923e7b013cac6c66462131232.zip
Merged 0.6 branch into trunk.
Permissions management was rewritten. Some permissions can now be specifically defined for non member and anonymous users. This migration: * is irreversible (please, don't forget to *backup* your database before upgrading) * resets role's permissions (go to "Admin -> Roles & Permissions" to set them after upgrading) git-svn-id: http://redmine.rubyforge.org/svn/trunk@674 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'db/migrate/062_insert_builtin_roles.rb')
-rw-r--r--db/migrate/062_insert_builtin_roles.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/db/migrate/062_insert_builtin_roles.rb b/db/migrate/062_insert_builtin_roles.rb
new file mode 100644
index 000000000..27c7475c3
--- /dev/null
+++ b/db/migrate/062_insert_builtin_roles.rb
@@ -0,0 +1,15 @@
+class InsertBuiltinRoles < ActiveRecord::Migration
+ def self.up
+ nonmember = Role.new(:name => 'Non member', :position => 0)
+ nonmember.builtin = Role::BUILTIN_NON_MEMBER
+ nonmember.save
+
+ anonymous = Role.new(:name => 'Anonymous', :position => 0)
+ anonymous.builtin = Role::BUILTIN_ANONYMOUS
+ anonymous.save
+ end
+
+ def self.down
+ Role.destroy_all 'builtin <> 0'
+ end
+end