Changeset

5483:f9cecbd03e11

mod_invites_adhoc: Fall back to generic allow_user_invites for role-less users Fixes #1752 Backport of Prosody rev dc0c20753d6c
author Matthew Wild <mwild1@gmail.com>
date Thu, 18 May 2023 18:15:50 +0200
parents 5482:2f7fff6c8c73
children 5484:bb083e9f78dd
files mod_invites_adhoc/mod_invites_adhoc.lua
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_invites_adhoc/mod_invites_adhoc.lua	Thu May 18 18:08:40 2023 +0200
+++ b/mod_invites_adhoc/mod_invites_adhoc.lua	Thu May 18 18:15:50 2023 +0200
@@ -57,7 +57,11 @@
 		return module:may(":invite-new-users", context);
 	elseif usermanager.get_roles then -- COMPAT w/0.12
 		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