support groups in _intersect_scopes

Requires db resolution
This commit is contained in:
Min RK
2021-05-21 15:23:31 +02:00
parent 40de16e0e1
commit fbea31d00a
4 changed files with 184 additions and 31 deletions

View File

@@ -38,7 +38,7 @@ from traitlets import Unicode
from traitlets import validate
from traitlets.config import SingletonConfigurable
from ..scopes import _intersect_scopes
from ..scopes import _intersect_expanded_scopes
from ..utils import url_path_join
@@ -70,7 +70,7 @@ def check_scopes(required_scopes, scopes):
if isinstance(required_scopes, str):
required_scopes = {required_scopes}
intersection = _intersect_scopes(required_scopes, scopes)
intersection = _intersect_expanded_scopes(required_scopes, scopes)
# re-intersect with required_scopes in case the intersection
# applies stricter filters than required_scopes declares
# e.g. required_scopes = {'read:users'} and intersection has only {'read:users!user=x'}