File

plugins/mod_authz_config.lua @ 10650:324a0c7d1c6a

net.resolvers.service: Fix resolving of targets with multiple IPs Each basic resolver was only used once and not kept around to try any IP addresses but the first one found.
author Kim Alvefur <zash@zash.se>
date Sun, 16 Feb 2020 23:48:31 +0100
parent 10635:675d9fbcbaed
line wrap: on
line source

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