DAQ: added authentication pathway for staff only, to seperate staff and active session check for beamline recovery operations

This commit is contained in:
2026-03-10 11:53:27 +01:00
parent d7fef70199
commit cd04619814
+3 -2
View File
@@ -91,8 +91,7 @@ def check_jwt_rw(cfg: BeamlineConfig, data: TokenData) -> None:
code=AuthErrorCode.SESSION_ALREADY_ACTIVE,
) from e
def check_jwt_staff(cfg: BeamlineConfig, data: TokenData) -> None:
def check_jwt_staff_only(data: TokenData) -> None:
if not data.staff:
raise UserRightsException(
message="Not member of the MX staff.",
@@ -100,6 +99,8 @@ def check_jwt_staff(cfg: BeamlineConfig, data: TokenData) -> None:
code=AuthErrorCode.NOT_STAFF,
)
def check_jwt_staff(cfg: BeamlineConfig, data: TokenData) -> None:
check_jwt_staff_only(data)
try:
cfg.try_set_active_session(data.session, SESSION_EXPIRE_SECONDS)
except Exception as e: