竞赛讨论区的置顶和锁定

This commit is contained in:
cxt 2016-12-30 19:53:00 +08:00
parent 7103001613
commit 6d894c53d5
1 changed files with 3 additions and 1 deletions

View File

@ -103,8 +103,10 @@ class Message < ActiveRecord::Base
:if => lambda {|message, user|
if message.project
user.allowed_to?(:edit_messages, message.project)
else
elsif message.course
user.allowed_to?(:edit_messages, message.course)
elsif message.contest
user.admin_of_contest?(message.contest)
end
}