Task to assign user developer role to all projects
This commit is contained in:
parent
22ec463764
commit
2d6a3e6b67
1 changed files with 10 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue