From 2d6a3e6b67ec1c469ac19d2d5e581d8425b229c6 Mon Sep 17 00:00:00 2001 From: Seif Attar Date: Thu, 23 Aug 2012 10:48:55 +0100 Subject: [PATCH] Task to assign user developer role to all projects --- lib/tasks/bulk_add_permission.rake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/tasks/bulk_add_permission.rake b/lib/tasks/bulk_add_permission.rake index 779f286f2fd..55797825e0c 100644 --- a/lib/tasks/bulk_add_permission.rake +++ b/lib/tasks/bulk_add_permission.rake @@ -14,3 +14,13 @@ task :add_users_to_project_teams => :environment do |t, args| UsersProject.bulk_import(project, admins, UsersProject::MASTER) end end + +desc "Add user to as a developer to all projects" +task :add_user_to_project_teams, [:email] => :environment do |t, args| + user_email = args.email + user = User.find_by_email(user_email) + + project_ids = Project.all.map(&:id) + + UsersProject.user_bulk_import(user,project_ids,UsersProject::DEVELOPER) +end