Added privilege check for seeing flagger usernames
Also reworked all places dealing with flagger names to use said privilege
This commit is contained in:
@@ -24,6 +24,16 @@ class PostEvent
|
||||
type_name.first
|
||||
end
|
||||
|
||||
def is_creator_visible?(user = CurrentUser.user)
|
||||
case event
|
||||
when PostAppeal
|
||||
true
|
||||
when PostFlag
|
||||
flag = event
|
||||
user.can_view_flagger?(flag.creator_id)
|
||||
end
|
||||
end
|
||||
|
||||
def attributes
|
||||
{
|
||||
"creator_id": nil,
|
||||
|
||||
Reference in New Issue
Block a user