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() :
|
if 'users' in service.attrs.keys() :
|
||||||
allowed_users = service['users'].split(',')
|
allowed_users = service['users'].split(',')
|
||||||
if allowed_users != ["Any"] and user_header not in allowed_users :
|
if allowed_users != ["Any"] and user_header not in allowed_users :
|
||||||
shouldremove = True
|
# Not allowed by user, wait for group eval
|
||||||
if 'groups' in service.attrs.keys() :
|
|
||||||
allowed_groups = service['groups'].split(',')
|
|
||||||
if not list(set(current_groups) & set(allowed_groups)) :
|
|
||||||
shouldremove = True
|
shouldremove = True
|
||||||
else :
|
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
|
shouldremove = False
|
||||||
if shouldremove :
|
if shouldremove :
|
||||||
service.decompose()
|
service.decompose()
|
||||||
|
Loading…
Reference in New Issue
Block a user