mirror of
https://github.com/9001/copyparty.git
synced 2026-03-28 11:02:51 +10:00
disable bans according to perms; closes #911
This commit is contained in:
@@ -862,6 +862,16 @@ class HttpCli(object):
|
||||
return self.conn.iphash.s(self.ip)
|
||||
|
||||
def cbonk(self, g: Garda, v: str, reason: str, descr: str) -> bool:
|
||||
cond = self.args.dont_ban
|
||||
if (
|
||||
cond == "any"
|
||||
or (cond == "auth" and self.uname != "*")
|
||||
or (cond == "aa" and self.avol)
|
||||
or (cond == "av" and self.can_admin)
|
||||
or (cond == "rw" and self.can_read and self.can_write)
|
||||
):
|
||||
return False
|
||||
|
||||
self.conn.hsrv.nsus += 1
|
||||
if not g.lim:
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user