Files
osem/lib/tasks/roles.rake
shlok007 7d408ee33c suggested changes
change description of organization_admin
remove assign_role callback
2017-06-28 06:55:30 +05:30

20 lines
877 B
Ruby

namespace :roles do
desc 'Adds back deleted roles to all conferences'
task add: :environment do
Organization.all.each do |org|
Role.where(name: 'organization_admin', resource: org).first_or_create(description: 'For the administrators of an organization and its conferences')
end
Conference.all.each do |c|
Role.where(name: 'organizer', resource: c).first_or_create(description: 'For the organizers of the conference (who shall have full access)')
Role.where(name: 'cfp', resource: c).first_or_create(description: 'For the members of the CfP team')
Role.where(name: 'info_desk', resource: c).first_or_create(description: 'For the members of the Info Desk team')
Role.where(name: 'volunteers_coordinator', resource: c).first_or_create(description: 'For the people in charge of volunteers')
end
puts 'All done!'
end
end