Skip to content

Commit

Permalink
reorder _get_type
Browse files Browse the repository at this point in the history
  • Loading branch information
seeker25 committed Dec 18, 2024
1 parent a2d1ed8 commit 2417fa9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions auth-api/src/auth_api/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,15 +258,15 @@ def _get_type(cls, user_from_context: UserContext) -> str:
or user_from_context.login_source == LoginSource.BCROS.value
):
user_type = Role.ANONYMOUS_USER.name
elif user_from_context.is_staff():
user_type = Role.STAFF.name
elif Role.GOV_ACCOUNT_USER.value in user_from_context.roles:
user_type = Role.GOV_ACCOUNT_USER.name
elif Role.PUBLIC_USER.value in user_from_context.roles or user_from_context.login_source in [
LoginSource.BCEID.value,
LoginSource.BCSC.value,
]:
user_type = Role.PUBLIC_USER.name
elif user_from_context.is_staff():
user_type = Role.STAFF.name
elif user_from_context.is_system():
user_type = Role.SYSTEM.name

Expand Down

0 comments on commit 2417fa9

Please sign in to comment.