summaryrefslogtreecommitdiffstats
path: root/app/controllers/roles_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/roles_controller.rb')
-rw-r--r--app/controllers/roles_controller.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/controllers/roles_controller.rb b/app/controllers/roles_controller.rb
index 790eb28d4..5f3885267 100644
--- a/app/controllers/roles_controller.rb
+++ b/app/controllers/roles_controller.rb
@@ -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