Create role by copy (#9258).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10285 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-09-03 17:04:28 +00:00
parent 1b64e4be5e
commit ca7498c2d6
6 changed files with 52 additions and 2 deletions
+4 -1
View File
@@ -36,8 +36,11 @@ class RolesController < ApplicationController
end
def new
# Prefills the form with 'Non member' role permissions
# Prefills the form with 'Non member' role permissions by default
@role = Role.new(params[:role] || {:permissions => Role.non_member.permissions})
if params[:copy].present? && @copy_from = Role.find_by_id(params[:copy])
@role.copy_from(@copy_from)
end
@roles = Role.sorted.all
end