hunter permission no longer allows identifying players
This commit is contained in:
parent
488295f7ce
commit
4b814ac9d4
|
@ -335,7 +335,7 @@ final class User(
|
||||||
val spyFu = env.security.userSpy(user).logTimeIfGt(s"$username security.userSpy", 2 seconds)
|
val spyFu = env.security.userSpy(user).logTimeIfGt(s"$username security.userSpy", 2 seconds)
|
||||||
val others = spyFu flatMap { spy =>
|
val others = spyFu flatMap { spy =>
|
||||||
val familyUserIds = user.id :: spy.otherUserIds.toList
|
val familyUserIds = user.id :: spy.otherUserIds.toList
|
||||||
env.user.noteApi.forMod(familyUserIds).logTimeIfGt(s"$username noteApi.forMod", 2 seconds) zip
|
(isGranted(_.ModNote) ?? env.user.noteApi.forMod(familyUserIds).logTimeIfGt(s"$username noteApi.forMod", 2 seconds)) zip
|
||||||
env.playban.api.bans(familyUserIds).logTimeIfGt(s"$username playban.bans", 2 seconds) zip
|
env.playban.api.bans(familyUserIds).logTimeIfGt(s"$username playban.bans", 2 seconds) zip
|
||||||
lila.security.UserSpy.withMeSortedWithEmails(env.user.repo, user, spy.otherUsers) map {
|
lila.security.UserSpy.withMeSortedWithEmails(env.user.repo, user, spy.otherUsers) map {
|
||||||
case notes ~ bans ~ othersWithEmail =>
|
case notes ~ bans ~ othersWithEmail =>
|
||||||
|
@ -343,7 +343,8 @@ final class User(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val identification = spyFu map { spy =>
|
val identification = spyFu map { spy =>
|
||||||
html.user.mod.identification(spy, env.security.printBan.blocks).some
|
(isGranted(_.Doxing) || (user.lameOrAlt && !user.hasTitle)) option
|
||||||
|
html.user.mod.identification(spy, env.security.printBan.blocks)
|
||||||
}
|
}
|
||||||
val irwin = env.irwin.api.reports.withPovs(user) map {
|
val irwin = env.irwin.api.reports.withPovs(user) map {
|
||||||
_ ?? { reps =>
|
_ ?? { reps =>
|
||||||
|
|
|
@ -174,7 +174,7 @@ object mod {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
isGranted(_.SetEmail) ?? frag(
|
(isGranted(_.Doxing) && isGranted(_.SetEmail)) ?? frag(
|
||||||
postForm(cls := "email", action := routes.Mod.setEmail(u.username))(
|
postForm(cls := "email", action := routes.Mod.setEmail(u.username))(
|
||||||
st.input(
|
st.input(
|
||||||
tpe := "email",
|
tpe := "email",
|
||||||
|
@ -507,10 +507,13 @@ object mod {
|
||||||
tbody(
|
tbody(
|
||||||
othersWithEmail.others.map {
|
othersWithEmail.others.map {
|
||||||
case lila.security.UserSpy.OtherUser(o, byIp, byFp) =>
|
case lila.security.UserSpy.OtherUser(o, byIp, byFp) =>
|
||||||
|
val dox = isGranted(_.Doxing) || (o.lameOrAlt && !o.hasTitle)
|
||||||
val myNotes = notes.filter(_.to == o.id)
|
val myNotes = notes.filter(_.to == o.id)
|
||||||
tr(o == u option (cls := "same"))(
|
tr(o == u option (cls := "same"))(
|
||||||
td(dataSort := o.id)(userLink(o, withBestRating = true, params = "?mod")),
|
if (dox || o == u) td(dataSort := o.id)(userLink(o, withBestRating = true, params = "?mod"))
|
||||||
td(othersWithEmail emailValueOf o),
|
else td,
|
||||||
|
if (dox) td(othersWithEmail emailValueOf o)
|
||||||
|
else td,
|
||||||
td(dataSort := (byIp ?? 3) + (byFp ?? 1))(
|
td(dataSort := (byIp ?? 3) + (byFp ?? 1))(
|
||||||
if (o == u) "-"
|
if (o == u) "-"
|
||||||
else List(byIp option "IP", byFp option "Print").flatten.mkString(", ")
|
else List(byIp option "IP", byFp option "Print").flatten.mkString(", ")
|
||||||
|
|
|
@ -43,6 +43,7 @@ object Permission {
|
||||||
case object Coach extends Permission("ROLE_COACH")
|
case object Coach extends Permission("ROLE_COACH")
|
||||||
case object Teacher extends Permission("ROLE_TEACHER")
|
case object Teacher extends Permission("ROLE_TEACHER")
|
||||||
case object ModNote extends Permission("ROLE_MOD_NOTE")
|
case object ModNote extends Permission("ROLE_MOD_NOTE")
|
||||||
|
case object ViewIpPrint extends Permission("ROLE_VIEW_IP_PRINT")
|
||||||
case object RemoveRanking extends Permission("ROLE_REMOVE_RANKING")
|
case object RemoveRanking extends Permission("ROLE_REMOVE_RANKING")
|
||||||
case object ReportBan extends Permission("ROLE_REPORT_BAN")
|
case object ReportBan extends Permission("ROLE_REPORT_BAN")
|
||||||
case object ModMessage extends Permission("ROLE_MOD_MESSAGE")
|
case object ModMessage extends Permission("ROLE_MOD_MESSAGE")
|
||||||
|
@ -80,17 +81,26 @@ object Permission {
|
||||||
ModLog,
|
ModLog,
|
||||||
SeeInsight,
|
SeeInsight,
|
||||||
UserSearch,
|
UserSearch,
|
||||||
ModNote,
|
|
||||||
RemoveRanking,
|
RemoveRanking,
|
||||||
ModMessage
|
ModMessage
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
case object Doxing
|
||||||
|
extends Permission(
|
||||||
|
"ROLE_DOXING",
|
||||||
|
List(
|
||||||
|
ModNote,
|
||||||
|
ViewIpPrint
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
case object Admin
|
case object Admin
|
||||||
extends Permission(
|
extends Permission(
|
||||||
"ROLE_ADMIN",
|
"ROLE_ADMIN",
|
||||||
List(
|
List(
|
||||||
Hunter,
|
Hunter,
|
||||||
|
Doxing,
|
||||||
ModerateForum,
|
ModerateForum,
|
||||||
IpBan,
|
IpBan,
|
||||||
PrintBan,
|
PrintBan,
|
||||||
|
|
|
@ -76,6 +76,7 @@ case class User(
|
||||||
def lame = marks.boost || marks.engine
|
def lame = marks.boost || marks.engine
|
||||||
|
|
||||||
def lameOrTroll = lame || marks.troll
|
def lameOrTroll = lame || marks.troll
|
||||||
|
def lameOrAlt = lame || marks.alt
|
||||||
def lameOrTrollOrAlt = lameOrTroll || marks.alt
|
def lameOrTrollOrAlt = lameOrTroll || marks.alt
|
||||||
|
|
||||||
def withMarks(f: UserMarks => UserMarks) = copy(marks = f(marks))
|
def withMarks(f: UserMarks => UserMarks) = copy(marks = f(marks))
|
||||||
|
|
Loading…
Reference in a new issue