IMPORTANT: due to a drive failure, as of 13-Mar-2021, the Mercurial repository had to be re-mirrored, which changed every commit SHA. The old SHAs and trees are backed up in the vault branches. Please migrate to the new branches as soon as you can.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
prosody/plugins/mod_authz_internal.lua

22 lines
489 B

local normalize = require "util.jid".prep;
local admin_jids = module:get_option_inherited_set("admins", {}) / normalize;
local host = module.host;
local role_store = module:open_store("roles");
local admin_role = { ["prosody:admin"] = true };
function get_user_roles(user)
if admin_jids:contains(user.."@"..host) then
return admin_role;
end
return role_store:get(user);
end
function get_jid_roles(jid)
if admin_jids:contains(jid) then
return admin_role;
end
return nil;
end