aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2025-01-13 11:50:03 +0100
committerKim Alvefur <zash@zash.se>2025-01-13 11:50:03 +0100
commit879cb1672f99d2fc859cfd2809eeab9d33e9f35e (patch)
tree53aa56ae9fbbc721f7d5d951f5b4be3b54211228 /plugins
parentdc80c46504718a166cb060d67310e57ab43a10b0 (diff)
downloadprosody-879cb1672f99d2fc859cfd2809eeab9d33e9f35e.tar.gz
prosody-879cb1672f99d2fc859cfd2809eeab9d33e9f35e.zip
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.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_authz_internal.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/mod_authz_internal.lua b/plugins/mod_authz_internal.lua
index 6006b447..7a06c904 100644
--- a/plugins/mod_authz_internal.lua
+++ b/plugins/mod_authz_internal.lua
@@ -8,7 +8,7 @@ local roles = require "prosody.util.roles";
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";