diff --git a/example-conf.yml b/example-conf.yml index fb5f294..46076f1 100644 --- a/example-conf.yml +++ b/example-conf.yml @@ -640,6 +640,14 @@ relay: # This block defines various options for the Relay plugin. You don't need this # if you aren't using it. + # Determines whether all opers should be able to create, link, delink, destroy, + # and adjust claim settings on relay channels. You can disable this if you want + # to configure link permissions in a more fine grained way, e.g. by granting each + # network admin their own PyLink account. + # This defaults to True if not set, for consistency with older (< 2.0) PyLink versions. + # Changing this setting requires a rehash and reload of the Relay plugin to apply. + allow_free_oper_links: true + # Determines whether all relay users' nicks will be tagged with their network, instead of only # when a nick collision occurs. It is recommended that you either leave this on or maintain a # list of nicks in "forcetag_nicks", so that your users don't complain about "nick in use" diff --git a/plugins/relay.py b/plugins/relay.py index 2d7c03f..4931849 100644 --- a/plugins/relay.py +++ b/plugins/relay.py @@ -27,9 +27,9 @@ datastore = structures.PickleDataStore('pylinkrelay', dbname) db = datastore.store default_permissions = {"*!*@*": ['relay.linked'], - "$ircop": ['relay.create', 'relay.linkacl*', - 'relay.destroy', 'relay.link', 'relay.delink', - 'relay.claim']} + "$ircop": ['relay.linkacl*']} +default_oper_permissions = {"$ircop": ['relay.create', 'relay.destroy', 'relay.link', + 'relay.delink', 'relay.claim']} ### INTERNAL FUNCTIONS @@ -63,6 +63,9 @@ def main(irc=None): permissions.add_default_permissions(default_permissions) + if 'relay' in conf.conf and conf.conf['relay'].get('allow_free_oper_links', True): + permissions.add_default_permissions(default_oper_permissions) + if irc is not None: # irc is defined when the plugin is reloaded. Otherwise, it means that we've just started the # server. Iterate over all connected networks and initialize their relay users. @@ -103,6 +106,7 @@ def die(irc=None): # 3) Unload our permissions. permissions.remove_default_permissions(default_permissions) + permissions.remove_default_permissions(default_oper_permissions) # 4) Save the database. datastore.die()