Allow TL4 users to accept answers (configurable via site setting)
This commit is contained in:
parent
11a0c293b8
commit
afb1c91c11
|
@ -1,6 +1,7 @@
|
|||
en:
|
||||
site_settings:
|
||||
allow_solved_on_all_topics: "Allow users to select solutions on all topics (by default you control this by editing categories)"
|
||||
accept_all_solutions_trust_level: "Minimum trust level required to accept solutions on any topic (even when not OP)"
|
||||
reports:
|
||||
accepted_solutions:
|
||||
title: "Accepted solutions"
|
||||
|
|
|
@ -2,3 +2,6 @@ plugins:
|
|||
allow_solved_on_all_topics:
|
||||
default: false
|
||||
client: true
|
||||
accept_all_solutions_trust_level:
|
||||
default: 4
|
||||
client: true
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue