mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 01:24:48 +08:00
DEV: Guardian for hiding about stats (#9841)
This commit is contained in:

committed by
GitHub

parent
cfff8b1f27
commit
bd57ae83f1
@ -21,7 +21,16 @@ class AboutSerializer < ApplicationSerializer
|
||||
:title,
|
||||
:locale,
|
||||
:version,
|
||||
:https
|
||||
:https,
|
||||
:can_see_about_stats
|
||||
|
||||
def can_see_about_stats
|
||||
scope.can_see_about_stats?
|
||||
end
|
||||
|
||||
def include_stats?
|
||||
can_see_about_stats
|
||||
end
|
||||
|
||||
def stats
|
||||
object.class.fetch_cached_stats || Jobs::AboutStats.new.execute({})
|
||||
|
Reference in New Issue
Block a user