mirror of
https://github.com/YunoHost/SSOwat.git
synced 2024-09-03 20:06:27 +02:00
Fix if no permission exist
This commit is contained in:
parent
02b4ecec8c
commit
f74619020d
1 changed files with 5 additions and 4 deletions
|
@ -267,16 +267,17 @@ end
|
|||
function has_access(user)
|
||||
user = user or authUser
|
||||
|
||||
logger.debug("User "..user.." try to access "..ngx.var.uri)
|
||||
|
||||
-- Get the longest url permission
|
||||
longest_permission_match = longest_url_path(permission_matches()) or ""
|
||||
|
||||
logger.debug("Longest permission match : "..longest_permission_match)
|
||||
|
||||
-- If no permission matches, it means that there is no
|
||||
-- permission defined for this url, a logged-in user can access it.
|
||||
-- If no permission matches, it means that there is no permission defined for this url.
|
||||
if longest_permission_match == "" then
|
||||
logger.debug("No access rules defined for user "..user..", assuming it can access.")
|
||||
return true
|
||||
logger.debug("No access rules defined for user "..user..", assuming it cannot access.")
|
||||
return false
|
||||
end
|
||||
|
||||
-- All user in this permission
|
||||
|
|
Loading…
Reference in a new issue