comparison plugins/mod_authz_internal.lua @ 11200:bf8f2da84007

Merge 0.11->trunk
author Kim Alvefur <zash@zash.se>
date Thu, 05 Nov 2020 22:31:25 +0100
parents 8f95308c3c45
children c32753ceb0f0
comparison
equal deleted inserted replaced
11199:6c7c50a4de32 11200:bf8f2da84007
1 local normalize = require "util.jid".prep;
2 local admin_jids = module:get_option_inherited_set("admins", {}) / normalize;
3 local host = module.host;
4 local role_store = module:open_store("roles");
5
6 local admin_role = { ["prosody:admin"] = true };
7
8 function get_user_roles(user)
9 if admin_jids:contains(user.."@"..host) then
10 return admin_role;
11 end
12 return role_store:get(user);
13 end
14
15 function get_jid_roles(jid)
16 if admin_jids:contains(jid) then
17 return admin_role;
18 end
19 return nil;
20 end
21
22