From f2bfa6d33c552d42b90ace8b014d803697afb3f1 Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Tue, 13 Aug 2024 20:29:26 +0100 Subject: [PATCH] Remove the OWNER scope as it's no longer used --- py/matching_test.py | 5 +---- py/state.py | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/py/matching_test.py b/py/matching_test.py index f9942de..29e6e2b 100644 --- a/py/matching_test.py +++ b/py/matching_test.py @@ -397,13 +397,10 @@ def test_auth_scopes(): tmp_state = state.State() id = "1" - tmp_state.set_user_scope(id, state.AuthScope.OWNER) - assert tmp_state.get_user_has_scope(id, state.AuthScope.OWNER) - assert tmp_state.get_user_has_scope(id, state.AuthScope.MATCHER) + assert not tmp_state.get_user_has_scope(id, state.AuthScope.MATCHER) id = "2" tmp_state.set_user_scope(id, state.AuthScope.MATCHER) - assert not tmp_state.get_user_has_scope(id, state.AuthScope.OWNER) assert tmp_state.get_user_has_scope(id, state.AuthScope.MATCHER) tmp_state.validate() diff --git a/py/state.py b/py/state.py index 74a5acb..81aafae 100644 --- a/py/state.py +++ b/py/state.py @@ -77,7 +77,6 @@ _MIGRATIONS = [ class AuthScope(str): """Various auth scopes""" - OWNER = "owner" MATCHER = "matcher" @@ -239,7 +238,7 @@ class State(): """ user = self._users.get(str(id), {}) scopes = user.get(_Key.SCOPES, []) - return AuthScope.OWNER in scopes or scope in scopes + return scope in scopes def set_user_active_in_channel(self, id: str, channel_id: str, active: bool = True): """Set a user as active (or not) on a given channel"""