资源栏目权限问题

This commit is contained in:
ouyangxuhua 2015-12-30 17:25:06 +08:00
parent e9cedf0eb9
commit 3deb5aff43
1 changed files with 1 additions and 2 deletions

View File

@ -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)