aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGravatar jesopo2018-08-18 18:28:41 +0100
committerGravatar jesopo2018-08-18 18:28:41 +0100
commit4da8a4ac3938e02617ee2157c13cd4f83ef99754 (patch)
tree6936f9e888b7326f5e206a7cdd40ea637d09dd6c /modules
parentAdded !resetkarma in karma.py (diff)
signature
Added code to preprocess check a command that only requires authentication, not
a permission
Diffstat (limited to 'modules')
-rw-r--r--modules/permissions.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/permissions.py b/modules/permissions.py
index 1c0c165c..46d43776 100644
--- a/modules/permissions.py
+++ b/modules/permissions.py
@@ -87,6 +87,7 @@ class Module(object):
def preprocess_command(self, event):
permission = event["hook"].kwargs.get("permission", None)
+ authenticated = event["hook"].kwargs.get("authenticated", False)
if permission:
identified = event["user"].identified
user_permissions = event["user"].get_setting("permissions", [])
@@ -94,6 +95,9 @@ class Module(object):
permission in user_permissions or "*" in user_permissions)
if not identified or not has_permission:
return "You do not have permission to do that"
+ elif authenticated:
+ if not event["user"].identified:
+ return "You need to be identified to use that command"
def my_permissions(self, event):
permissions = event["user"].get_setting("permissions", [])