Skip to content

Commit

Permalink
[ICAT-SSO] - Only allow login from one proposal at a time
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-oscarsson committed Oct 1, 2024
1 parent ff03944 commit 7169790
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions mxcubeweb/core/components/user/usermanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,15 +423,10 @@ def _login(self, login_id: str, password: str) -> LimsSessionManager:
if inhouse and not (inhouse and is_local_host()):
raise Exception("In-house only allowed from localhost")

non_inhouse_active_users = self.active_logged_in_users(exclude_inhouse=True)

# Only allow other users to log-in if they are from the same proposal
# (making sure to exclude inhouse users who are always allowed to login)

if (
(not inhouse)
and non_inhouse_active_users
and (login_id not in [p.split("-")[0] for p in non_inhouse_active_users])
active_users
and (login_id not in [p.split("-")[0] for p in active_users])
and not HWR.beamline.lims.is_user_login_type()
):
raise Exception("Another user is already logged in")
Expand Down

0 comments on commit 7169790

Please sign in to comment.