FEATURE: Featured topic for user profile & card (#8461)

This commit is contained in:
Mark VanLandingham
2019-12-09 11:15:47 -08:00
committed by GitHub
parent b5236591e9
commit 14cb386f1e
34 changed files with 418 additions and 95 deletions

View File

@ -123,4 +123,11 @@ module UserGuardian
end
end
end
def can_feature_topic?(user, topic)
return false if !SiteSetting.allow_featured_topic_on_user_profiles?
return false if !is_me?(user) && !is_staff?
return false if topic.read_restricted_category? || topic.private_message?
topic.user_id === user.id
end
end