From aad451c07e02e83d5da4fbd4d4d9d8a9a54b8176 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 6 May 2022 17:08:49 +0100 Subject: mod_invites_adhoc: Fall back to generic allow_user_invites for role-less users Fixes #1752 --- plugins/mod_invites_adhoc.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'plugins/mod_invites_adhoc.lua') diff --git a/plugins/mod_invites_adhoc.lua b/plugins/mod_invites_adhoc.lua index 4554d919..bd6f0c2e 100644 --- a/plugins/mod_invites_adhoc.lua +++ b/plugins/mod_invites_adhoc.lua @@ -45,7 +45,11 @@ local invite_result_form = dataforms.new({ local function may_invite_new_users(jid) if usermanager.get_roles then local user_roles = usermanager.get_roles(jid, module.host); - if not user_roles then return; end + if not user_roles then + -- User has no roles we can check, just return default + return allow_user_invites; + end + if user_roles["prosody:admin"] then return true; end -- cgit v1.2.3