# HG changeset patch # User Kim Alvefur # Date 1711205053 -3600 # Node ID f8b9095f7862555354b59e1dc85e1b89caa2c7f0 # Parent a88c43de648c437469b9b97a50e4906aa56970fa mod_compat_roles: Fix attempt to index a nil value #1847 permissions[] is not a map with role names as keys since 817bc9873fc2 but instead a level with host names were added. This was likely an oversight. Refactored towards railroad. diff -r a88c43de648c -r f8b9095f7862 mod_compat_roles/mod_compat_roles.lua --- a/mod_compat_roles/mod_compat_roles.lua Fri Mar 22 11:02:04 2024 +0100 +++ b/mod_compat_roles/mod_compat_roles.lua Sat Mar 23 15:44:13 2024 +0100 @@ -50,8 +50,14 @@ if not role_permissions then return false; end + if role_permissions[permission] then + return true; + end local next_role = role_inheritance[role_name]; - return not not permissions[role_name][permission] or (next_role and role_may(host, next_role, permission)); + if not next_role then + return false; + end + return role_may(host, next_role, permission); end function moduleapi.may(self, action, context)