From 3deb5aff43b8e9b99c473786d80806ed333f88a9 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Wed, 30 Dec 2015 17:25:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=A0=8F=E7=9B=AE=E6=9D=83?= =?UTF-8?q?=E9=99=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/message.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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)