From cd04619814ac3944a3323eed51efbbab027947ea Mon Sep 17 00:00:00 2001 From: appleb_m Date: Tue, 10 Mar 2026 11:53:27 +0100 Subject: [PATCH] DAQ: added authentication pathway for staff only, to seperate staff and active session check for beamline recovery operations --- src/aare/daq/auth.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/aare/daq/auth.py b/src/aare/daq/auth.py index e480964a..3af7f247 100644 --- a/src/aare/daq/auth.py +++ b/src/aare/daq/auth.py @@ -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: