Implemented revision and test suite bug

This commit is contained in:
0mar
2021-03-17 16:01:22 +01:00
parent f3fc0e96de
commit 6f6561122b
3 changed files with 8 additions and 7 deletions

View File

@@ -440,17 +440,17 @@ class BaseHandler(RequestHandler):
self.raw_scopes = set()
app_log.debug("Loading and parsing scopes")
if not self.current_user:
app_log.debug("No user found, no scopes loaded")
try: # check for oauth tokens as long as #3380 not merged
user_from_oauth = self.get_current_user_oauth_token()
# check for oauth tokens as long as #3380 not merged
user_from_oauth = self.get_current_user_oauth_token()
if user_from_oauth is not None:
self.raw_scopes = {f'read:users!user={user_from_oauth.name}'}
except:
pass
else:
app_log.debug("No user found, no scopes loaded")
else:
api_token = self.get_token()
if api_token:
self.raw_scopes = scopes.get_scopes_for(api_token)
elif self.current_user:
else:
self.raw_scopes = scopes.get_scopes_for(self.current_user)
self.parsed_scopes = scopes.parse_scopes(self.raw_scopes)
app_log.debug("Found scopes [%s]", ",".join(self.raw_scopes))