mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
[V3 permissions] more docs + minor addition. (#1737)
* more info * docstring
This commit is contained in:
parent
de96f8b9f9
commit
9eb6bb7738
@ -37,6 +37,7 @@ For each of those, settings have varying priorities (listed below, highest to lo
|
||||
7. Role settings (see below)
|
||||
8. Server whitelist
|
||||
9. Server blacklist
|
||||
10. Default settings
|
||||
|
||||
For the role whitelist and blacklist settings,
|
||||
roles will be checked individually in order from highest to lowest role the user has
|
||||
@ -73,3 +74,32 @@ An example of the expected format is shown below.
|
||||
- 96733288462286848
|
||||
default: allow
|
||||
|
||||
----------------------
|
||||
Example configurations
|
||||
----------------------
|
||||
|
||||
Locking Audio cog to approved server(s) as a bot owner
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]permissions setglobaldefault Audio deny
|
||||
[p]permissions addglobalrule allow Audio [server ID or name]
|
||||
|
||||
Locking Audio to specific voice channel(s) as a serverowner or admin:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]permissions setguilddefault Audio deny
|
||||
[p]permissions addguildrule allow Audio [voice channel ID or name]
|
||||
|
||||
Allowing extra roles to use cleanup
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]permissions addguildrule allow Cleanup [role ID]
|
||||
|
||||
Preventing cleanup from being used in channels where message history is important:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]permissions addguildrule deny Cleanup [channel ID or mention]
|
||||
|
||||
@ -12,7 +12,7 @@ from .resolvers import val_if_check_is_valid, resolve_models
|
||||
from .yaml_handler import yamlset_acl, yamlget_acl
|
||||
from .converters import CogOrCommand, RuleType
|
||||
|
||||
_models = ["owner", "guildowner", "admin", "mod"]
|
||||
_models = ["owner", "guildowner", "admin", "mod", "all"]
|
||||
|
||||
_ = Translator("Permissions", __file__)
|
||||
|
||||
@ -94,7 +94,7 @@ class Permissions:
|
||||
defering to check logic
|
||||
This works since all checks must be True to run
|
||||
"""
|
||||
v = await self.check_overrides(ctx, "mod")
|
||||
v = await self.check_overrides(ctx, "all")
|
||||
|
||||
if v is False:
|
||||
return False
|
||||
@ -109,7 +109,7 @@ class Permissions:
|
||||
ctx: `redbot.core.context.commands.Context`
|
||||
The context of the command
|
||||
level: `str`
|
||||
One of 'owner', 'guildowner', 'admin', 'mod'
|
||||
One of 'owner', 'guildowner', 'admin', 'mod', 'all'
|
||||
|
||||
Returns
|
||||
-------
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user