- std::string umodes;
- std::string cmodes;
- for(char c='A'; c <= 'z'; c++)
- {
- ModeHandler* mh = ServerInstance->Modes->FindMode(c, MODETYPE_USER);
- if (mh && mh->NeedsOper() && loctarg->HasModePermission(c, MODETYPE_USER))
- umodes.push_back(c);
- mh = ServerInstance->Modes->FindMode(c, MODETYPE_CHANNEL);
- if (mh && mh->NeedsOper() && loctarg->HasModePermission(c, MODETYPE_CHANNEL))
- cmodes.push_back(c);
- }
- context.Write("modeperms", "user=" + umodes + " channel=" + cmodes);
-
- CheckContext::List opcmdlist(context, "commandperms");
- for (OperInfo::PrivSet::const_iterator i = oper->AllowedOperCommands.begin(); i != oper->AllowedOperCommands.end(); ++i)
- opcmdlist.Add(*i);
- opcmdlist.Flush();
- CheckContext::List privlist(context, "permissions");
- for (OperInfo::PrivSet::const_iterator i = oper->AllowedPrivs.begin(); i != oper->AllowedPrivs.end(); ++i)
- privlist.Add(*i);
- privlist.Flush();
+ context.Write("chanmodeperms", GetAllowedOperOnlyModes(loctarg, MODETYPE_CHANNEL));
+ context.Write("usermodeperms", GetAllowedOperOnlyModes(loctarg, MODETYPE_USER));
+ context.Write("snomaskperms", GetAllowedOperOnlySnomasks(loctarg));
+ context.Write("commandperms", oper->AllowedOperCommands.ToString());
+ context.Write("permissions", oper->AllowedPrivs.ToString());