From 4da8a4ac3938e02617ee2157c13cd4f83ef99754 Mon Sep 17 00:00:00 2001 From: jesopo Date: Sat, 18 Aug 2018 18:28:41 +0100 Subject: [PATCH] Added code to preprocess check a command that only requires authentication, not a permission --- modules/permissions.py | 4 ++++ 1 file changed, 4 insertions(+) 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", [])