Rename 'all' metascope to more descriptive 'inherit'

since it means 'inheriting' the owner's permissions

'all' prompted the question 'all of what, exactly?'

Additionally, fix some NameErrors that should have been KeyErrors
This commit is contained in:
Min RK
2021-10-25 14:35:52 +02:00
parent b2f0208fcc
commit b25517efe8
8 changed files with 33 additions and 29 deletions

View File

@@ -397,9 +397,11 @@ class UserTokenListAPIHandler(APIHandler):
token_roles = body.get('roles')
try:
api_token = user.new_api_token(
note=note, expires_in=body.get('expires_in', None), roles=token_roles
note=note,
expires_in=body.get('expires_in', None),
roles=token_roles,
)
except NameError:
except KeyError:
raise web.HTTPError(404, "Requested roles %r not found" % token_roles)
except ValueError:
raise web.HTTPError(