Skip to content

Commit

Permalink
Always allow inhouse to login locally
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-oscarsson committed May 2, 2018
1 parent ad5af91 commit 3343fa3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mxcube3/routes/Login.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,14 @@ def login():
"existing_session": limsutils.lims_existing_session(login_res),
"inhouse": inhouse}

_logged_in_users = logged_in_users(exclude_inhouse=True)
_users = logged_in_users(exclude_inhouse=True)

# Only allow in-house log-in from local host
if inhouse and not (inhouse and is_local_host()):
return deny_access("In-house only allowed from localhost")

# Only allow other users to log-in if they are from the same proposal
elif _logged_in_users and (loginID not in _logged_in_users):
if (not inhouse) and _users and (loginID not in _users):
return deny_access("Another user is already logged in")

# Only allow local login when remote is disabled
Expand Down

0 comments on commit 3343fa3

Please sign in to comment.