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: