# HG changeset patch # User Kim Alvefur # Date 1736765403 -3600 # Node ID eb676b6f05e3aa8a518538fbac905eab765b538a # Parent 7b632cd0e00d32505906d9748be7198411b0b0b6 mod_authz_internal: Make host considered the parent configurable This bestows the role specified by the 'host_user_role' setting onto users of that host. For simplicity, only a single host can be specified. Making it configurable allows for setups where VirtualHost and related Components may be siblings instead of having a subdomain relationship. For setups with many VirtualHosts sharing a single Component, the 'server_user_role' setting is more appropriate. Even more complicated setups would have to resort to mod_firewall or similar. diff -r 7b632cd0e00d -r eb676b6f05e3 plugins/mod_authz_internal.lua --- a/plugins/mod_authz_internal.lua Fri Jan 10 12:34:29 2025 +0100 +++ b/plugins/mod_authz_internal.lua Mon Jan 13 11:50:03 2025 +0100 @@ -8,7 +8,7 @@ local config_global_admin_jids = module:context("*"):get_option_set("admins", {}) / normalize; local config_admin_jids = module:get_option_inherited_set("admins", {}) / normalize; local host = module.host; -local host_suffix = host:gsub("^[^%.]+%.", ""); +local host_suffix = module:get_option_string("parent_host", (host:gsub("^[^%.]+%.", ""))); local hosts = prosody.hosts; local is_anon_host = module:get_option_string("authentication") == "anonymous";