Allow TL4 users to accept answers (configurable via site setting)

This commit is contained in:
Sam
2016-03-31 12:06:03 +11:00
parent 11a0c293b8
commit afb1c91c11
3 changed files with 6 additions and 1 deletions
+2 -1
View File
@@ -193,7 +193,8 @@ after_initialize do
def can_accept_answer?(topic)
allow_accepted_answers_on_category?(topic.category_id) && (
is_staff? || (
authenticated? && !topic.closed? && topic.user_id == current_user.id
authenticated? && ((!topic.closed? && topic.user_id == current_user.id) ||
(current_user.trust_level >= SiteSetting.accept_all_solutions_trust_level))
)
)
end