aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_authz_internal.lua
blob: 41b8d9f066932efbd0de6f66440f867e85d5c717 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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