diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-05-17 14:35:00 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-05-17 14:35:00 +0000 |
commit | 52b5b292032977ecb523316fb19e20996564030b (patch) | |
tree | 8827fe2c0e330417b07abe78d6fabe1f1fcc7281 /app/controllers/projects_controller.rb | |
parent | ce8bd1602035f07e8f70f92d4c2a15698b6f50c5 (diff) | |
download | redmine-52b5b292032977ecb523316fb19e20996564030b.tar.gz redmine-52b5b292032977ecb523316fb19e20996564030b.zip |
Adds a setting to choose which role is given to a non-admin user who creates a project (#1007).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2754 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/projects_controller.rb')
-rw-r--r-- | app/controllers/projects_controller.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 5f508cb5f..355e1bd46 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -78,7 +78,8 @@ class ProjectsController < ApplicationController @project.set_parent!(params[:project]['parent_id']) if User.current.admin? && params[:project].has_key?('parent_id') # Add current user as a project member if he is not admin unless User.current.admin? - m = Member.new(:user => User.current, :roles => Role.builtin(false).find(:all, :order => 'position', :limit => 1)) + r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first + m = Member.new(:user => User.current, :roles => [r]) @project.members << m end flash[:notice] = l(:notice_successful_create) |