opertypes: oper classes + types — reusable capability classes and named roles (WHOIS title, auto usermodes/snomasks/vhost + level on oper-up, per-type command enforcement via on_pre_command); ships 5 built-in (helpop/globop/admin/servadmin/netadmin); oper blocks gain type=<id>; a typeless oper keeps full access

This commit is contained in:
Jean Chevronnet 2026-08-20 10:05:11 +00:00
parent f3ce0e61ef
commit 01516d5fdc
No known key found for this signature in database
GPG key ID: 439666D63A9477E4
6 changed files with 509 additions and 5 deletions

View file

@ -59,6 +59,7 @@ pub enum Event {
uid: Uid,
ok: bool,
level: u32,
oper_type: Option<String>,
},
/// A background MKPASSWD hash finished (KDFs run off the core thread).
MkpasswdResult {
@ -235,10 +236,11 @@ impl Ircd {
crate::modules::ident::on_result(&mut self.server, uid, ident);
self.try_register(uid); // ident may have been the last hold
}
Event::OperAuth { uid, ok, level } => {
Event::OperAuth { uid, ok, level, oper_type } => {
if ok {
self.server.oper_up(uid);
crate::modules::operlevels::set(&mut self.server, uid, level);
crate::modules::opertypes::apply(&mut self.server, uid, oper_type.as_deref());
} else if self.server.users.contains_key(&uid) {
self.server
.numeric(uid, ERR_PASSWDMISMATCH, ":Password incorrect");