mirror of
https://github.com/ergochat/ergo.git
synced 2026-04-26 10:38:23 +02:00
fix missing read permissions checks for METADATA (#2382)
These were incorrectly refactored out in #2277. Also group the two write subcommands together, then the three read subcommands.
This commit is contained in:
parent
5bb94efaf6
commit
10da32292f
@ -3269,6 +3269,16 @@ func metadataRegisteredHandler(client *Client, config *Config, subcommand string
|
||||
}
|
||||
}
|
||||
|
||||
case "clear":
|
||||
if !metadataCanIEditThisTarget(client, targetObj) {
|
||||
noKeyPerms("*")
|
||||
return
|
||||
}
|
||||
|
||||
values := targetObj.ClearMetadata()
|
||||
|
||||
playMetadataList(rb, client.Nick(), target, values)
|
||||
|
||||
case "get":
|
||||
if !metadataCanISeeThisTarget(client, targetObj) {
|
||||
noKeyPerms("*")
|
||||
@ -3295,19 +3305,19 @@ func metadataRegisteredHandler(client *Client, config *Config, subcommand string
|
||||
}
|
||||
|
||||
case "list":
|
||||
playMetadataList(rb, client.Nick(), target, targetObj.ListMetadata())
|
||||
|
||||
case "clear":
|
||||
if !metadataCanIEditThisTarget(client, targetObj) {
|
||||
if !metadataCanISeeThisTarget(client, targetObj) {
|
||||
noKeyPerms("*")
|
||||
return
|
||||
}
|
||||
|
||||
values := targetObj.ClearMetadata()
|
||||
|
||||
playMetadataList(rb, client.Nick(), target, values)
|
||||
playMetadataList(rb, client.Nick(), target, targetObj.ListMetadata())
|
||||
|
||||
case "sync":
|
||||
if !metadataCanISeeThisTarget(client, targetObj) {
|
||||
noKeyPerms("*")
|
||||
return
|
||||
}
|
||||
|
||||
if targetChannel != nil {
|
||||
syncChannelMetadata(server, rb, targetChannel)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user