diff --git a/default.yaml b/default.yaml index 84911b9b..227fd0e6 100644 --- a/default.yaml +++ b/default.yaml @@ -584,9 +584,8 @@ oper-classes: # capability names capabilities: - - "local_kill" - - "local_ban" - - "local_unban" + - "kill" + - "ban" - "nofakelag" - "roleplay" - "relaymsg" diff --git a/docs/MANUAL.md b/docs/MANUAL.md index 26134b36..badbf075 100644 --- a/docs/MANUAL.md +++ b/docs/MANUAL.md @@ -930,9 +930,8 @@ oper-classes: # capability names capabilities: - - "local_kill" - - "local_ban" - - "local_unban" + - "kill" + - "ban" - "nofakelag" # ircd operators diff --git a/irc/commands.go b/irc/commands.go index cb81fd2f..6134eaae 100644 --- a/irc/commands.go +++ b/irc/commands.go @@ -170,7 +170,7 @@ func init() { handler: killHandler, minParams: 1, oper: true, - capabs: []string{"local_kill"}, //TODO(dan): when we have S2S, this will be checked in the command handler itself + capabs: []string{"kill"}, }, "KLINE": { handler: klineHandler, diff --git a/irc/config.go b/irc/config.go index de1a7ca8..e2423981 100644 --- a/irc/config.go +++ b/irc/config.go @@ -649,7 +649,7 @@ type OperClass struct { // OperatorClasses returns a map of assembled operator classes from the given config. func (conf *Config) OperatorClasses() (map[string]*OperClass, error) { fixupCapability := func(capab string) string { - return strings.TrimPrefix(capab, "oper:") // #868 + return strings.TrimPrefix(strings.TrimPrefix(capab, "oper:"), "local_") // #868, #1442 } ocs := make(map[string]*OperClass) diff --git a/irc/handlers.go b/irc/handlers.go index 3aec6edc..015a68f8 100644 --- a/irc/handlers.go +++ b/irc/handlers.go @@ -826,7 +826,7 @@ func formatBanForListing(client *Client, key string, info IPBanInfo) string { func dlineHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *ResponseBuffer) bool { // check oper permissions oper := client.Oper() - if oper == nil || !oper.Class.Capabilities.Has("local_ban") { + if oper == nil || !oper.Class.Capabilities.Has("ban") { rb.Add(nil, server.name, ERR_NOPRIVS, client.nick, msg.Command, client.t("Insufficient oper privs")) return false } @@ -1364,7 +1364,7 @@ func klineHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Res details := client.Details() // check oper permissions oper := client.Oper() - if oper == nil || !oper.Class.Capabilities.Has("local_ban") { + if oper == nil || !oper.Class.Capabilities.Has("ban") { rb.Add(nil, server.name, ERR_NOPRIVS, details.nick, msg.Command, client.t("Insufficient oper privs")) return false } @@ -2814,7 +2814,7 @@ func topicHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Res func unDLineHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *ResponseBuffer) bool { // check oper permissions oper := client.Oper() - if oper == nil || !oper.Class.Capabilities.Has("local_unban") { + if oper == nil || !oper.Class.Capabilities.Has("ban") { rb.Add(nil, server.name, ERR_NOPRIVS, client.nick, msg.Command, client.t("Insufficient oper privs")) return false } @@ -2853,7 +2853,7 @@ func unKLineHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *R details := client.Details() // check oper permissions oper := client.Oper() - if oper == nil || !oper.Class.Capabilities.Has("local_unban") { + if oper == nil || !oper.Class.Capabilities.Has("ban") { rb.Add(nil, server.name, ERR_NOPRIVS, details.nick, msg.Command, client.t("Insufficient oper privs")) return false } diff --git a/irc/nickserv.go b/irc/nickserv.go index 1bdba9b2..c311a8ba 100644 --- a/irc/nickserv.go +++ b/irc/nickserv.go @@ -1090,7 +1090,7 @@ func nsClientsHandler(service *ircService, server *Server, client *Client, comma func nsClientsListHandler(service *ircService, server *Server, client *Client, params []string, rb *ResponseBuffer) { target := client - hasPrivs := client.HasRoleCapabs("local_ban") + hasPrivs := client.HasRoleCapabs("ban") if 0 < len(params) { target = server.clients.Get(params[0]) if target == nil { @@ -1141,10 +1141,10 @@ func nsClientsLogoutHandler(service *ircService, server *Server, client *Client, service.Notice(rb, client.t("No such nick")) return } - // User must have "local_kill" privileges to logout other user sessions. + // User must have "kill" privileges to logout other user sessions. if target != client { oper := client.Oper() - if oper == nil || !oper.Class.Capabilities.Has("local_kill") { + if oper == nil || !oper.Class.Capabilities.Has("kill") { service.Notice(rb, client.t("Insufficient oper privs")) return } diff --git a/traditional.yaml b/traditional.yaml index 4976e67f..1436ff7f 100644 --- a/traditional.yaml +++ b/traditional.yaml @@ -556,9 +556,8 @@ oper-classes: # capability names capabilities: - - "local_kill" - - "local_ban" - - "local_unban" + - "kill" + - "ban" - "nofakelag" - "roleplay" - "relaymsg"