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"""