# HG changeset patch # User Matthew Wild # Date 1580164132 0 # Node ID 675d9fbcbaedd664d58e953a94b5fe6b20ace43d # Parent c9e1cb7a38b85022db7a61a0f861316ca9a2aa47 mod_authz_internal, usermanager: Rename to mod_authz_config diff -r c9e1cb7a38b8 -r 675d9fbcbaed core/usermanager.lua --- a/core/usermanager.lua Mon Jan 27 22:09:19 2020 +0000 +++ b/core/usermanager.lua Mon Jan 27 22:28:52 2020 +0000 @@ -56,7 +56,7 @@ local function initialize_host(host) local host_session = hosts[host]; - local authz_provider_name = config.get(host, "authorization") or "internal"; + local authz_provider_name = config.get(host, "authorization") or "config"; local authz_mod = modulemanager.load(host, "authz_"..authz_provider_name); host_session.authz = authz_mod or global_authz_provider; diff -r c9e1cb7a38b8 -r 675d9fbcbaed plugins/mod_authz_config.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/mod_authz_config.lua Mon Jan 27 22:28:52 2020 +0000 @@ -0,0 +1,16 @@ +local normalize = require "util.jid".prep; +local admin_jids = module:get_option_inherited_set("admins", {}) / normalize; +local host = module.host; + +local admin_role = { ["prosody:admin"] = true }; + +function get_user_roles(user) + return get_jid_roles(user.."@"..host); +end + +function get_jid_roles(jid) + if admin_jids:contains(jid) then + return admin_role; + end + return nil; +end diff -r c9e1cb7a38b8 -r 675d9fbcbaed plugins/mod_authz_internal.lua --- a/plugins/mod_authz_internal.lua Mon Jan 27 22:09:19 2020 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -local normalize = require "util.jid".prep; -local admin_jids = module:get_option_inherited_set("admins", {}) / normalize; -local host = module.host; - -local admin_role = { ["prosody:admin"] = true }; - -function get_user_roles(user) - return get_jid_roles(user.."@"..host); -end - -function get_jid_roles(jid) - if admin_jids:contains(jid) then - return admin_role; - end - return nil; -end