aboutsummaryrefslogtreecommitdiffstats
path: root/core/moduleapi.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2022-08-17 16:38:53 +0100
committerMatthew Wild <mwild1@gmail.com>2022-08-17 16:38:53 +0100
commitf5768f63c993cee9f7f8e3c89db7e4e3080beab5 (patch)
tree8de97d71efdbbfbdb54fdd7c0da47c811bb7a183 /core/moduleapi.lua
parent2b0676396dc84dad48735a9e3782bb4f13b36471 (diff)
downloadprosody-f5768f63c993cee9f7f8e3c89db7e4e3080beab5.tar.gz
prosody-f5768f63c993cee9f7f8e3c89db7e4e3080beab5.zip
mod_authz_internal, and more: New iteration of role API
These changes to the API (hopefully the last) introduce a cleaner separation between the user's primary (default) role, and their secondary (optional) roles. To keep the code sane and reduce complexity, a data migration is needed for people using stored roles in 0.12. This can be performed with prosodyctl mod_authz_internal migrate <host>
Diffstat (limited to 'core/moduleapi.lua')
-rw-r--r--core/moduleapi.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/moduleapi.lua b/core/moduleapi.lua
index 8790a9d3..73ce4911 100644
--- a/core/moduleapi.lua
+++ b/core/moduleapi.lua
@@ -538,6 +538,7 @@ function api:load_resource(path, mode)
end
function api:open_store(name, store_type)
+ if self.host == "*" then return nil, "global-storage-not-supported"; end
return require"core.storagemanager".open(self.host, name or self.name, store_type);
end
@@ -629,7 +630,7 @@ function api:may(action, context)
local role;
local node, host = jid_split(context);
if host == self.host then
- role = hosts[host].authz.get_user_default_role(node);
+ role = hosts[host].authz.get_user_role(node);
else
role = hosts[self.host].authz.get_jid_role(context);
end