Add active check

This commit is contained in:
2026-08-05 00:24:22 +02:00
parent 0497d1bbcf
commit bbb41e41ab
2 changed files with 2 additions and 2 deletions

View File

@@ -103,6 +103,8 @@ def checkAccess(key: str, db: Session):
card = db.exec(select(Card).where(Card.key == key)).one()
for auth in card.group.accessauths:
logger.info(f"checking auth: {auth.name}")
if not auth.is_active:
return False
if auth.type == "timetable":
for timetable in auth.timetables:
logger.info(f" checking timetable {timetable.id}")

View File

@@ -18,7 +18,6 @@ from desfire.enums import (
DESFireKeyType,
)
from desfire.schemas import FilePermissions, FileSettings, KeySettings
from dotenv import load_dotenv
from fastapi import HTTPException, status
from smartcard.CardRequest import CardRequest
from smartcard.CardType import AnyCardType
@@ -30,7 +29,6 @@ from app.services.settings import settings
logger = logging.getLogger(__name__)
# ENV vars
load_dotenv()
MIFARE_APP_MASTER_KEY = settings.mifare_app_master_key
MIFARE_ACL_READ_BASE_KEY = settings.mifare_acl_read_base_key
MIFARE_ACL_WRITE_BASE_KEY = settings.mifare_acl_write_base_key