diff options
author | Matthew Wild <mwild1@gmail.com> | 2020-01-27 22:28:52 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2020-01-27 22:28:52 +0000 |
commit | 34abcc8bd5da00be68279f31b747a341f23d1c11 (patch) | |
tree | 263b9d0ef37db4820e8151228c398f2533c68cbc /plugins/mod_authz_config.lua | |
parent | b177628d3c336437b7098935b2e1040dc254e46a (diff) | |
download | prosody-34abcc8bd5da00be68279f31b747a341f23d1c11.tar.gz prosody-34abcc8bd5da00be68279f31b747a341f23d1c11.zip |
mod_authz_internal, usermanager: Rename to mod_authz_config
Diffstat (limited to 'plugins/mod_authz_config.lua')
-rw-r--r-- | plugins/mod_authz_config.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/plugins/mod_authz_config.lua b/plugins/mod_authz_config.lua new file mode 100644 index 00000000..41b8d9f0 --- /dev/null +++ b/plugins/mod_authz_config.lua @@ -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 |