access-default: do not crash if the rules section is not defined in the config
This commit is contained in:
@@ -44,11 +44,13 @@ end
|
|||||||
|
|
||||||
function getPermissions (properties)
|
function getPermissions (properties)
|
||||||
local section = Conf.get_section ("access.rules")
|
local section = Conf.get_section ("access.rules")
|
||||||
|
if section then
|
||||||
local matched, mprops = JsonUtils.match_rules_update_properties (
|
local matched, mprops = JsonUtils.match_rules_update_properties (
|
||||||
section, properties)
|
section, properties)
|
||||||
if (matched > 0 and mprops["default_permissions"]) then
|
if (matched > 0 and mprops["default_permissions"]) then
|
||||||
return mprops["default_permissions"], mprops["access"]
|
return mprops["default_permissions"], mprops["access"]
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return nil, nil
|
return nil, nil
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user