Operclass block

The operclass block is used to define ircop permissions. It is referred to from oper::operclass in the Oper block.

The operclass block allows you to define permissions in a very fine-grained manner. If you just want to use some good defaults, then see the default oper classses at the end of this article.

Syntax & Examples
operclass name { parent xyz; /* OPTIONAL: can be used to inherit permissions from another operclass block */ privileges { .....privileges to grant to this oper class...... }; };

Each operclass has a name. You define the privileges in operclass::privileges. Optionally you can use operclass::parent to have this operclass inherit all permissions from another operclass.

How privileges work
By default the oper using an operclass does not have special powers (this is not entirely true, actually). You must grant each privilege via operclass::privileges.

For example to grant the right to /KILL users: operclass name { privileges { kill; This would be the same as: operclass name { privileges { kill { allow; };

Many privileges allow you to define even more options, which go in a sub-block, like: operclass name { privileges { kill { allow { local yes; }; /* only allow KILL on local users, not remote */ }; You can also have multiple allow blocks. The following would permit SPAMFILTER, but only in a limited matter: operclass name { privileges { spamfilter { /* May delete ANY spamfilter */ allow { what del; };                       /* May add spamfilter with action 'block' */ allow { action block; };                       /* (all the rest is denied) */ };

Permissions available
The following permissions are available

add
These contain access right which allow an IRCOp to add data to certain files

add::description
Allows IRCOp to use /SDESC to change the server description. The server description is shown in /LINKS and... yeah where else? ;)

add::motd
Allows IRCOp to use /ADDMOTD to add a line to the MOTD.

add::motd
Allows IRCOp to use /ADDMOTD to add a line to the MOTD.

add::omotd
Allows IRCOp to use /ADDOMOTD to add a line to the OPERMOTD.

chat::admin
Permits the use of /ADMINCHAT(?).. wait.. were are about to remove that ;)

chat::wallops
Permits the use of /WALLOPS to post messages to wallops users (umode +w)

gline
Allows /GLINE

kline
Allows /KLINE

zline
Allows /ZLINE and /GZLINE

You can use .... to differentiate.

samode
Allows /SAMODE

sajoin
Allows /SAJOIN

sapart
Allows /SAPART

shun
Allows /SHUN

spamfilter
Allows /SPAMFILTER

trace
Permits /TRACE

tsctl
Permits /TSCTL

Default oper classes
UnrealIRCd ships with a number of operclass blocks, these are in the file operclass.default.conf. You can use these for inspiration or just use them directly from your Oper block.

The default operclass blocks consist of:
 * locop: this has the least amount of privileges. The powers of this IRCOp type are (mostly) limited to the local server, for example it can /KILL and /KLINE local users but not remote users. This IRCOp does not have any special privileges in channels nor can it "see" much additional information of users. For example, they can see the IP of users (so they can /KLINE properly) but they cannot see if a user is in a secret channel (+s).
 * globop: Global IRC Operator. Has a good set of privileges. Can for example /KILL and /GLINE users on all servers. Can "see" extra things (override::see) such as secret channels in /LIST and /WHOIS.
 * admin: Server administrator. Similar to globop but includes the ability to use a few more potentially dangerous but powerful commands such as /SPAMFILTER.
 * services-admin: This level adds the ability to use /SAJOIN, /SAPART and /SAMODE.
 * netadmin: This is the highest level. Compared to services-admin it also includes the ability to deop or kill services bots and some other unusual things.

In addition to the above we also have globop-with-override, admin-with-override, services-admin-with-override and netadmin-with-override: these operclasses are the same as above but add the ability to use OperOverride. In other words: to walk through bans, changes modes without being op'ed, and so on. See OperOverride for more information.

Customizing oper classes
If you want to tweak an operclass, change a few permissions, then you can do so in two ways:
 * By copy-pasting the block(s) from operclass.default.conf
 * By creating a new operclass and using 'inheritance'. You set operclass::parent to an operclass to use as a base and then extend the operclass by adding / removing privileges.

We highly suggest you read below about both methods and only after that decide which one to use.

Copy-pasting
NOTE: You should never edit operclass.default.conf directly as it will be overwritten upon each upgrade! (hence the name operclass.default.conf)

This method is easy:
 * Copy the relevant block(s) to your own configuration file
 * Give the operclass block(s) a different name
 * Edit the block to add/remove privileges

The downside of this method is that when we add new privileges in later UnrealIRCd versions then your (custom) IRCOp classes won't have these rights by default. You would have to edit your operclass and add the new privileges manually (or not). This can happen when we move existing privileges that are currently granted to all IRCOps to a new privilege flag, or when we split existing privileges into 2 separate privileges. Since the operclass system is relatively new this is likely to happen (almost) every UnrealIRCd release. Of course, if you understand this downside and find it acceptable, then it's perfectly fine if you use this method.

Using inheritance
Inheritance works better than copy-paste (for small changes, anyway) and requires less maintenance on your side. This is because when we add new rights in UnrealIRCd in later versions we will add them to the default blocks and your customized block would automatically inherit them.

Inheritance should work well in the majority of the cases. However if you have a lot of changes then it may be better to just go for the copy-pasting method explained earlier.

Example
Say you like the locop operclass but want a few things changed:
 * You want the ircop to be able to 'see' extra things such as secret channels.
 * The locop class allows /ZLINE and /KLINE, but you want to only allow /KLINE.

operclass special { parent locop; /* we inherit the settings from 'locop' and then tweak them below.. */      privileges { /* we add a 'tkl' block with only 'kline', this means: only allow kline (and not zline too) */ tkl { kline; };

override { see; }; /* add the override::see capability */

/* all the other privileges are inherited from the 'locop' operclass */ }; };