Fixing display logic
This commit is contained in:
parent
4c85099f9e
commit
fcf20a1b25
@ -52,12 +52,19 @@ async def serve_file(request: Request, file_path: str) :
|
||||
if 'users' in service.attrs.keys() :
|
||||
allowed_users = service['users'].split(',')
|
||||
if allowed_users != ["Any"] and user_header not in allowed_users :
|
||||
shouldremove = True
|
||||
if 'groups' in service.attrs.keys() :
|
||||
allowed_groups = service['groups'].split(',')
|
||||
if not list(set(current_groups) & set(allowed_groups)) :
|
||||
# Not allowed by user, wait for group eval
|
||||
shouldremove = True
|
||||
else :
|
||||
# Any user can access it or user is explicitely allowed
|
||||
shouldremove = False
|
||||
continue
|
||||
if 'groups' in service.attrs.keys() : # If no group directive user directive prevails
|
||||
allowed_groups = service['groups'].split(',')
|
||||
if not list(set(current_groups) & set(allowed_groups)) :
|
||||
# No matching user claim and allowed group
|
||||
shouldremove = True
|
||||
else :
|
||||
# Matching group claim should override previous removals
|
||||
shouldremove = False
|
||||
if shouldremove :
|
||||
service.decompose()
|
||||
|
Loading…
Reference in New Issue
Block a user