Comparison

plugins/mod_authz_internal.lua @ 13232:e0ab20519ce5

plugins: Use get_option_array for some list shaped options Passing something from module:get_option() to ipairs() suggests that the option is a list of some sort.
author Kim Alvefur <zash@zash.se>
date Fri, 21 Jul 2023 22:48:54 +0200
parent 13170:082c7d856e61
comparison
equal deleted inserted replaced
13231:6a11d92ae436 13232:e0ab20519ce5
88 }; 88 };
89 89
90 90
91 -- Process custom roles from config 91 -- Process custom roles from config
92 92
93 local custom_roles = module:get_option("custom_roles", {}); 93 local custom_roles = module:get_option_array("custom_roles", {});
94 for n, role_config in ipairs(custom_roles) do 94 for n, role_config in ipairs(custom_roles) do
95 local ok, err = pcall(register_role, role_config); 95 local ok, err = pcall(register_role, role_config);
96 if not ok then 96 if not ok then
97 module:log("error", "Error registering custom role %s: %s", role_config.name or tostring(n), err); 97 module:log("error", "Error registering custom role %s: %s", role_config.name or tostring(n), err);
98 end 98 end