Mercurial > prosody-modules
comparison mod_http_admin_api/mod_http_admin_api.lua @ 5887:2aa66e928aa0
mod_http_admin_api: Allow specifying roles for invitations
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 16 Apr 2024 14:15:16 +0100 |
parents | 6c11e1b4066d |
children | 432efc39572f |
comparison
equal
deleted
inserted
replaced
5886:2c85397d7241 | 5887:2aa66e928aa0 |
---|---|
151 if not options.groups then | 151 if not options.groups then |
152 return 400; | 152 return 400; |
153 end | 153 end |
154 invite = invites.create_group(options.groups, { | 154 invite = invites.create_group(options.groups, { |
155 source = source; | 155 source = source; |
156 roles = options.roles; | |
156 }, options.ttl); | 157 }, options.ttl); |
157 elseif invite_type == "account" then | 158 elseif invite_type == "account" then |
158 invite = invites.create_account(options.username, { | 159 invite = invites.create_account(options.username, { |
159 source = source; | 160 source = source; |
160 groups = options.groups; | 161 groups = options.groups; |
162 roles = options.roles; | |
161 }, options.ttl); | 163 }, options.ttl); |
162 else | 164 else |
163 return 400; | 165 return 400; |
164 end | 166 end |
165 if not invite then | 167 if not invite then |