Software /
code /
prosody
Comparison
util/pubsub.lua @ 9104:e1ca373a7e09
util.pubsub: Tweak default affiliation of access models (fixes failing test)
11:56:59 MattJ> Someone who has the ability to subscribe does not have the "subscriber"
affiliation until they actually subscribe, they just have the normal "none" affiliation
(which has permission to subscribe)
11:58:05 MattJ> However if the access model is whitelist, then anyone not on the whitelist
has an implicit negative affiliation, which we don't currently have, so I just named "restricted"
11:58:16 MattJ> Since it doesn't exist in any code yet, it has no permissions
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 04 Aug 2018 12:00:46 +0100 |
parent | 9098:d5bc306e93aa |
child | 9106:e70b9e8bc443 |
comparison
equal
deleted
inserted
replaced
9103:d5a7d2697b19 | 9104:e1ca373a7e09 |
---|---|
115 local node_obj = self.nodes[node]; | 115 local node_obj = self.nodes[node]; |
116 local access_model = node_obj and node_obj.config.access_model | 116 local access_model = node_obj and node_obj.config.access_model |
117 or self.config.node_defaults.access_model; | 117 or self.config.node_defaults.access_model; |
118 | 118 |
119 if access_model == "open" then | 119 if access_model == "open" then |
120 return "subscriber"; | 120 return "none"; |
121 elseif access_model == "whitelist" then | 121 elseif access_model == "whitelist" then |
122 return "none"; | 122 return "restricted"; |
123 end | 123 end |
124 | 124 |
125 if self.config.access_models then | 125 if self.config.access_models then |
126 local check = self.config.access_models[access_model]; | 126 local check = self.config.access_models[access_model]; |
127 if check then | 127 if check then |