2014-06-26 11:43:03 +08:00
|
|
|
# -*coding:utf-8 -*-
|
|
|
|
class ModifyStudentRoles < ActiveRecord::Migration
|
|
|
|
def change
|
|
|
|
# 修改学生权限
|
|
|
|
# 添加回复讨论区权限
|
|
|
|
role = Role.find_by_name('学生')
|
|
|
|
if role
|
|
|
|
role.permissions.append(:add_messages)
|
2014-07-01 15:29:16 +08:00
|
|
|
role.save(:validate => false)
|
2014-06-26 11:43:03 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|