mirror of
https://github.com/YunoHost/SSOwat.git
synced 2024-09-03 20:06:27 +02:00
access.lua: move helper at the top with the other sugar stuff
This commit is contained in:
parent
99749decdc
commit
cac360bee9
1 changed files with 13 additions and 12 deletions
25
access.lua
25
access.lua
|
@ -79,6 +79,19 @@ function uri_args_string(args)
|
||||||
return string.sub(String, 1, string.len(String) - 1)
|
return string.sub(String, 1, string.len(String) - 1)
|
||||||
end
|
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
|
-- 1. AUTHENTICATION
|
||||||
-- Check wether or not this is a logged-in user
|
-- 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
|
-- 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
|
-- No permission object found = no access
|
||||||
if permission == nil then
|
if permission == nil then
|
||||||
logger:debug("No permission matching request for "..ngx.var.uri.." ... Assuming access is denied")
|
logger:debug("No permission matching request for "..ngx.var.uri.." ... Assuming access is denied")
|
||||||
|
|
Loading…
Add table
Reference in a new issue