diff --git a/app/models/message.rb b/app/models/message.rb index f0e2ff2d3..f59f778a8 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -40,7 +40,6 @@ class Message < ActiveRecord::Base # 课程/项目 消息 has_many :course_messages, :class_name =>'CourseMessage', :as => :course_message, :dependent => :destroy has_many :forge_messages, :class_name => 'ForgeMessage', :as => :forge_message, :dependent => :destroy - has_many :org_activities, :class_name => 'OrgActivity', :dependent => :destroy has_many :at_messages, as: :at_message, dependent: :destroy has_many :ActivityNotifies,:as => :activity, :dependent => :destroy @@ -152,7 +151,7 @@ class Message < ActiveRecord::Base end def org_subfield_editable_by?(usr) - usr && usr.logged? && usr.admin? && usr.admin_of_org?(self.board.org_subfield.organization) + usr && usr.logged? && (usr.admin? || self.author == usr ||usr.admin_of_org?(self.board.org_subfield.organization)) end def course_destroyable_by?(usr)