Skip to content

Commit

Permalink
Hotfix #1 - issue with roles comparison (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonKirill authored May 30, 2024
1 parent 52ffe49 commit 6b8742b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion chat_server/server_utils/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ def validate_session(
min_required_role > UserRoles.GUEST
and user.get("is_tmp")
or not any(
user_role > min_required_role for user_role in user.get("roles", [])
getattr(UserRoles, user_role.upper(), UserRoles.GUEST)
>= min_required_role
for user_role in user.get("roles", [])
)
):
raise UserUnauthorizedException()
Expand Down
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


__version__ = "0.4.6"
__version__ = "0.4.7a2"

0 comments on commit 6b8742b

Please sign in to comment.