diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-09-28 14:51:08 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-09-28 14:51:08 +0000 |
commit | 7e7ac5340a281ed767066af0b5f4dd45a3d7076f (patch) | |
tree | 891640b0548c0d3063daddb219006d120fa312c3 /db | |
parent | 9a7fb0ad7be0ee3403f5b89eb0c16b68c991d519 (diff) | |
download | redmine-7e7ac5340a281ed767066af0b5f4dd45a3d7076f.tar.gz redmine-7e7ac5340a281ed767066af0b5f4dd45a3d7076f.zip |
Adds buit-in groups to give specific permissions to anonymous and non members users per project (#17976).
git-svn-id: http://svn.redmine.org/redmine/trunk@13417 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20140920094058_insert_builtin_groups.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/db/migrate/20140920094058_insert_builtin_groups.rb b/db/migrate/20140920094058_insert_builtin_groups.rb new file mode 100644 index 000000000..ec505af2f --- /dev/null +++ b/db/migrate/20140920094058_insert_builtin_groups.rb @@ -0,0 +1,21 @@ +class InsertBuiltinGroups < ActiveRecord::Migration + def up + Group.reset_column_information + + unless GroupAnonymous.any? + g = GroupAnonymous.new(:lastname => 'Anonymous users') + g.status = 1 + g.save :validate => false + end + unless GroupNonMember.any? + g = GroupNonMember.new(:lastname => 'Non member users') + g.status = 1 + g.save :validate => false + end + end + + def down + GroupAnonymous.delete_all + GroupNonMember.delete_all + end +end |