Skip to content

Commit

Permalink
docs, privileges: move general overview of IRC privileges to doc page
Browse files Browse the repository at this point in the history
The history and brief overview of how IRC privileges work is not part of
the module/class documentation. It's more appropriate to explain in the
doc page about privileges as a general concept.
  • Loading branch information
dgw committed Nov 1, 2023
1 parent 12b00b0 commit b8c2d99
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 25 deletions.
23 changes: 23 additions & 0 deletions docs/source/plugin/privileges.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,29 @@ This will give both OP and Voice privileges to the user named "Nickname" in the
message it registers and updates its knowledge of a user's privileges in a
channel, which can be used by plugins in various ways.

Historically, these two privilege levels ("op" and "voiced") were the only
channel privileges available:

* :attr:`~sopel.privileges.AccessLevel.OP`: channel operator, set and unset by
modes ``+o`` and ``-o``
* :attr:`~sopel.privileges.AccessLevel.VOICE`: the privilege to send messages to
a channel with the ``+m`` mode, set and unset by modes ``+v`` and ``-v``

Since then, other privileges have been adopted by IRC servers and clients:

* :attr:`~sopel.privileges.AccessLevel.HALFOP`: intermediate level between VOICE
and OP, set and unset by modes ``+h`` and ``-h``
* :attr:`~sopel.privileges.AccessLevel.ADMIN`: channel admin, above OP and below
OWNER, set and unset by modes ``+a`` and ``-a``
* :attr:`~sopel.privileges.AccessLevel.OWNER`: channel owner, above ADMIN and OP,
set and unset by modes ``+q`` and ``-q``

.. important::

Not all IRC networks support these added privilege modes. If you are writing
a plugin for public distribution, ensure your code behaves sensibly if only
``+v`` (voice) and ``+o`` (op) modes exist.

Access rights
=============

Expand Down
25 changes: 0 additions & 25 deletions sopel/privileges.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,6 @@
class AccessLevel(enum.IntFlag):
"""Enumeration of available user privilege levels.
Privilege levels
================
Historically, there were two user privilege levels in a channel:
* :data:`~AccessLevel.OP`: channel operator, set and unset by modes ``+o``
and ``-o``
* :data:`~AccessLevel.VOICE`: the privilege to send messages to a channel
with the ``+m`` mode, set and unset by modes ``+v`` and ``-v``
Since then, other privileges have been adopted by IRC servers and clients:
* :data:`~AccessLevel.HALFOP`: intermediate level between VOICE and OP, set
and unset by modes ``+h`` and ``-h``
* :data:`~AccessLevel.ADMIN`: channel admin, above OP and below OWNER, set
and unset by modes ``+a`` and ``-a``
* :data:`~AccessLevel.OWNER`: channel owner, above ADMIN and OP, set and
unset by modes ``+q`` and ``-q``
.. important::
Not all IRC networks support these added privilege modes. If you are
writing a plugin for public distribution, ensure your code behaves
sensibly if only +v (voice) and +o (op) modes exist.
Comparing privileges
====================
Expand Down

0 comments on commit b8c2d99

Please sign in to comment.