mirror of
https://github.com/YunoHost/SSOwat.git
synced 2024-09-03 20:06:27 +02:00
At least one rule should exist + should be the longest match
This commit is contained in:
parent
a13a2fee1e
commit
ff700062a5
1 changed files with 4 additions and 1 deletions
|
@ -293,7 +293,10 @@ function has_access(user)
|
|||
logger.debug("Longest allowed match : "..longest_allowed_match)
|
||||
logger.debug("Longest protected match : "..longest_protected_match)
|
||||
|
||||
if string.len(longest_allowed_match) >= string.len(longest_protected_match) then
|
||||
-- For the user to be able to access the content, at least one rule should
|
||||
-- exist and it should be the longest match
|
||||
if longest_allowed_match ~= ""
|
||||
and string.len(longest_allowed_match) >= string.len(longest_protected_match) then
|
||||
logger.debug("Logged-in user can access "..ngx.var.uri)
|
||||
log_access(user, longest_allowed_match)
|
||||
return true
|
||||
|
|
Loading…
Add table
Reference in a new issue