Software /
code /
prosody
Changeset
10635:675d9fbcbaed
mod_authz_internal, usermanager: Rename to mod_authz_config
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 27 Jan 2020 22:28:52 +0000 |
parents | 10634:c9e1cb7a38b8 |
children | 10636:a9c975a0f113 |
files | core/usermanager.lua plugins/mod_authz_config.lua plugins/mod_authz_internal.lua |
diffstat | 3 files changed, 17 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- 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;
--- /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
--- 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