don't show team leaders activity in mod logs
This commit is contained in:
parent
8a5053364c
commit
7cb5de7f95
|
@ -11,6 +11,7 @@ import lila.db.paginator._
|
|||
import lila.hub.actorApi.timeline.{ Propagate, ForumPost }
|
||||
import lila.hub.ActorLazyRef
|
||||
import lila.mod.ModlogApi
|
||||
import lila.security.{ Granter ⇒ MasterGranter }
|
||||
import lila.user.{ User, Context }
|
||||
import tube._
|
||||
|
||||
|
@ -111,7 +112,7 @@ final class PostApi(
|
|||
(env.categApi denormalize view.categ) >>
|
||||
env.recent.invalidate >>-
|
||||
(indexer ! RemovePost(post)))
|
||||
_ ← modLog.deletePost(mod, post.userId, post.author, post.ip,
|
||||
_ ← MasterGranter(_.ModerateForum)(mod) ?? modLog.deletePost(mod, post.userId, post.author, post.ip,
|
||||
text = "%s / %s / %s".format(view.categ.name, view.topic.name, post.text))
|
||||
} yield true.some)
|
||||
} yield ()).value.void
|
||||
|
|
|
@ -9,6 +9,7 @@ import lila.db.Implicits._
|
|||
import lila.db.paginator._
|
||||
import lila.hub.actorApi.timeline.{ Propagate, ForumPost }
|
||||
import lila.hub.ActorLazyRef
|
||||
import lila.security.{ Granter ⇒ MasterGranter }
|
||||
import lila.user.{ User, Context }
|
||||
import tube._
|
||||
|
||||
|
@ -79,8 +80,10 @@ private[forum] final class TopicApi(
|
|||
env.recent.invalidate
|
||||
|
||||
def toggleClose(categ: Categ, topic: Topic, mod: User): Funit =
|
||||
TopicRepo.close(topic.id, topic.open) >>
|
||||
modLog.toggleCloseTopic(mod, categ.name, topic.name, topic.open)
|
||||
TopicRepo.close(topic.id, topic.open) >> {
|
||||
MasterGranter(_.ModerateForum)(mod) ??
|
||||
modLog.toggleCloseTopic(mod, categ.name, topic.name, topic.open)
|
||||
}
|
||||
|
||||
def denormalize(topic: Topic): Funit = for {
|
||||
nbPosts ← PostRepo countByTopics List(topic)
|
||||
|
|
|
@ -7,5 +7,8 @@ object Granter {
|
|||
def apply(permission: Permission)(user: User): Boolean =
|
||||
Permission(user.roles) exists (_ is permission)
|
||||
|
||||
def apply(f: Permission.type => Permission)(user: User): Boolean =
|
||||
apply(f(Permission))(user)
|
||||
|
||||
def superAdmin(user: User): Boolean = apply(Permission.SuperAdmin)(user)
|
||||
}
|
||||
|
|
1
todo
1
todo
|
@ -70,7 +70,6 @@ at least locally, the forum search user:mephostophilis returns no result
|
|||
check team average elo http://en.lichess.org/inbox/benuegti#bottom
|
||||
if game ends during move -> bug
|
||||
search bug http://fr.lichess.org/forum/search?text=user:aybabtu
|
||||
don't show team leaders activity in mod logs
|
||||
LilaError['[analysis] fred65 already analyses ueogn4fr, won't process ueogn4fr']
|
||||
|
||||
---
|
||||
|
|
Loading…
Reference in a new issue