change which alt usernames a mod can see

closes lichess-org/tavern#53
pull/8351/head
Thibault Duplessis 2021-03-10 18:42:01 +01:00
parent 534828aef6
commit 70cd803a78
2 changed files with 2 additions and 2 deletions

View File

@ -554,7 +554,7 @@ object mod {
dataTags := s"${other.ips.mkString(" ")} ${other.fps.mkString(" ")}",
cls := (o == u) option "same"
)(
if (o == u || Granter.canViewAltUsernames(mod, u))
if (o == u || Granter.canViewAltUsername(mod, o))
td(dataSort := o.id)(userLink(o, withBestRating = true, params = "?mod"))
else td,
isGranted(_.Admin) option td(othersWithEmail emailValueOf o),

View File

@ -43,7 +43,7 @@ object Granter {
def canViewEmail(mod: Holder, user: User): Boolean =
is(_.Admin)(mod)
def canViewAltUsernames(mod: Holder, user: User): Boolean =
def canViewAltUsername(mod: Holder, user: User): Boolean =
is(_.Admin)(mod) || {
(is(_.Hunter)(mod) && user.marks.engine) ||
(is(_.Shusher)(mod) && user.marks.troll)