Remove the OWNER scope as it's no longer used
This commit is contained in:
parent
f4f6df90fb
commit
f2bfa6d33c
2 changed files with 2 additions and 6 deletions
|
@ -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()
|
||||
|
|
|
@ -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"""
|
||||
|
|
Loading…
Add table
Reference in a new issue