diff --git a/access.lua b/access.lua index 69355d4..e048ea2 100644 --- a/access.lua +++ b/access.lua @@ -79,6 +79,19 @@ function uri_args_string(args) return string.sub(String, 1, string.len(String) - 1) end +function element_is_in_table(element, table) + if table then + for _, el in pairs(table) do + if el == element then + return true + end + end + end + + return false +end + + -- ########################################################################### -- 1. AUTHENTICATION -- Check wether or not this is a logged-in user @@ -203,18 +216,6 @@ end -- Or because the logged-in user is listed in the "users" list of the perm -- ########################################################################### -function element_is_in_table(element, table) - if table then - for _, el in pairs(table) do - if el == element then - return true - end - end - end - - return false -end - -- No permission object found = no access if permission == nil then logger:debug("No permission matching request for "..ngx.var.uri.." ... Assuming access is denied")