Software / code / prosody
Comparison
plugins/mod_authz_internal.lua @ 13831:bf4cd327966f
Merge 13.0->trunk
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Wed, 09 Apr 2025 10:59:28 +0100 |
| parent | 13827:bcb69302423e |
comparison
equal
deleted
inserted
replaced
| 13826:53eb500b19a4 | 13831:bf4cd327966f |
|---|---|
| 296 module:log("debug", "Adding policy %s for permission %s on role %s", policy, action, role_name); | 296 module:log("debug", "Adding policy %s for permission %s on role %s", policy, action, role_name); |
| 297 return role:set_permission(action, policy); | 297 return role:set_permission(action, policy); |
| 298 end | 298 end |
| 299 | 299 |
| 300 function get_role_by_name(role_name) | 300 function get_role_by_name(role_name) |
| 301 return assert(role_registry[role_name], role_name); | 301 local role = role_registry[role_name]; |
| 302 if not role then | |
| 303 return error("Unknown role: "..role_name); | |
| 304 end | |
| 305 return role, role_name; | |
| 302 end | 306 end |
| 303 | 307 |
| 304 function get_all_roles() | 308 function get_all_roles() |
| 305 return role_registry; | 309 return role_registry; |
| 306 end | 310 end |