add new data from NCCU
This commit is contained in:
parent
89b1aace8a
commit
d027cf8e6a
|
@ -59,4 +59,29 @@ namespace :nccu do
|
|||
|
||||
end
|
||||
|
||||
task :add_nccu_account_1009 => :environment do
|
||||
a = ["blannytg@nccu.edu.tw","yucca@nccu.edu.tw","fish14@nccu.edu.tw","amanda13@nccu.edu.tw"]
|
||||
users_ary = User.any_in(email: a)
|
||||
NewsBulletinCategory.all.each do |cate|
|
||||
oa = ObjectAuth.first({conditions:{title: "submit",obj_authable_type: "NewsBulletinCategory",obj_authable_id: cate.id}})
|
||||
oa.privilege_users = oa.privilege_users + users_ary
|
||||
oa.save
|
||||
end
|
||||
|
||||
a=["annieayu@nccu.edu.tw","blannytg@nccu.edu.tw","yucca@nccu.edu.tw","amanda13@nccu.edu.tw"]
|
||||
users_ary = User.any_in(email: a)
|
||||
key = 'Announcement'
|
||||
bc = BulletinCategory.first({conditions:{key: key}})
|
||||
oa = ObjectAuth.first({conditions:{title: "submit",obj_authable_type: "BulletinCategory",obj_authable_id: bc.id}})
|
||||
oa.privilege_users = oa.privilege_users + users_ary
|
||||
oa.save
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
Loading…
Reference in New Issue