INNER CODE UNIT · Python
entry_allowed_groups
NextWeb4/lan-file-transfer · lan_transfer/api.py:178
def entry_allowed_groups(entry: dict[str, Any]) -> list[str]:
groups = entry.get("allowed_groups")
if isinstance(groups, list) and groups:
cleaned: list[str] = []
for group in groups:
normalized = GROUP_DEFAULT if str(group) == GROUP_LEGACY_DEFAULT else str(group)
if normalized not in cleaned:
cleaned.append(normalized)
return cleaned or [GROUP_DEFAULT]
return [GROUP_DEFAULT]
def entry_owner(entry: dict[str, Any]) -> str:
return str(entry.get("owner_username") or ROLE_ADMIN)
def entry_is_quarantined(entry: dict[str, Any]) -> bool:
return entry.get("audit_status") in {"failed", "pending"}